title: Error when building Apache Cordova project in Visual Studio - Could not find module \node_modules\vs-tac\app.js (again!)
body: <p>I fixed this or a very similar issue with building in debug (and I assume in a release version) my Visual Studio 2015 Community TACO Apache Cordova project (the one I'm working on or a blank new project from the template - which is what I've provided output from here, below, the blank one)  just about 24 hours ago, but now the problem has 'mysteriously' reappeared. </p>
  
  <pre><code>Error Cannot find module 'C:\Users\myusername\Documents\Visual Studio 2015\Projects\BlankCordovaApp3TestZ\BlankCordovaApp3TestZ\node_modules\vs-tac\app.js' 
  </code></pre>
  
  <p>(the last part of the path does not exist, i.e. there is no \node_modules\ folder. There is a vs-tac folder here, of course, </p>
  
  <pre><code>C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\APACHECORDOVATOOLS\packages\vs-tac
  </code></pre>
  
  <p>,as mentioned in the BUILD output at the bottom. Some updated info: I see that the project which I was successfully debugging before I un/re-installed all my project plugins does have the node_modules folder with many sub-folders but not vs-tac.</p>
  
  <p>I had everything working: debug on Ripple, Android AVDs, my Android device.  Two days ago I cleared the Cordova cache (for a stupid reason) and started getting the error. </p>
  
  <p>After hours of troubleshooting, I got it working again, I thought by running (my last try):</p>
  
  <pre><code>npm install -g npm
  </code></pre>
  
  <h1>Before that I had attempted fixing by --></h1>
  
  <ul>
  <li>Clearing the cache again</li>
  <li>Renaming the folder: C:\Users\myusername\AppData\Local\Microsoft\Phone Tools\CoreCon (So that VS recereates it)</li>
  <li>Renaming the folder C:\Users\myusername\AppData\Roaming\Microsoft\VisualStudio\MDA\vs-npm  (So that VS recereates it)</li>
  <li>Tried to re-install vs-tac (no quotes on the path, didnt work, but I got the issue resolved anyway - today I used the quotes)</li>
  <li>Verified the npmrc file had the fix: i.e. its content was --> prefix=C:\Users\myusername\AppData\Roaming\npm</li>
  </ul>
  
  <p>After again being able to debug, I came to a point today where i decided to uninstall my project's jquery module (2.2.3), and it looked like i need to uninstall jquery.mobile (1.4.5) and Bootstrap (3.3.7) also to do so, since I thought I might have a too high version of jquery causing an issue with my project's code. I re-installed the same except jquery at 2.1.0.</p>
  
  <p>After the module uninstall/reinstall just mentioned the vs-tac issue came back! Also, for the first time, an NPM dependency not installed issue in the dependency tree! After a little messing around, I opened a new Apache Cordova project from the template... the dependency issue is gone but not the vs-tac build issue.</p>
  
  <p>I have tried all of the above fix atttemps again today and cannot resolve it this time, so far...</p>
  
  <h1>Here is the output from some of those attempts at fixing my issue today (from an Admin Node.js command prompt) --></h1>
  
  <pre><code>C:\Windows\System32&gt;npm install -g npm
  C:\Users\myusername\AppData\Roaming\npm\npm -&gt; C:\Users\myusername\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
  C:\Users\myusername\AppData\Roaming\npm\npx -&gt; C:\Users\myusername\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
  + npm@5.3.0
  updated 1 package in 64.141s //This update seems to happen every time I run this command, which is odd for something global
  
  C:\Windows\System32&gt;npm install -g "C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\Packages\vs-tac"
  C:\Users\myusername\AppData\Roaming\npm\vs-tac-cli -&gt; C:\Users\myusername\AppData\Roaming\npm\node_modules\vs-tac\vs-tac-cli.cmd
  + vs-tac@1.0.42
  updated 1 package in 4.406s
  </code></pre>
  
  <h3>ENVIRONMENT INFORMATION --></h3>
  
  <pre><code>Microsoft Visual Studio Community 2015 Version 14.0.25431.01 Update 3
  Microsoft .NET Framework Version 4.7.02046
  Installed Version: Community
  Visual Studio Tools for Apache Cordova   Update 10
  Microsoft Visual Studio Tools for Applications 2015   00322-20000-00000-AA328
  JavaScript Language Service   2.0
  JavaScript Project System   2.0
  
  In VS Tools &gt; Options &gt; Projects and Solutions &gt; External Web Tools I have:
  C:\Program Files\nodejs (at the top, then)
  .\node_modules\.bin
  $(VSINSTALLDIR)\Web\External
  $(PATH)
  $(VSINSTALLDIR)\Web\External\git
  (all above are checked - not changed recently)  
  
  I don't think what is in VS Tools &gt; Options &gt; Tools for Apache Cordova &gt; Environment Variable Overrides is relevant in this case and did not include.
  
  Cordova CLI --&gt; 6.1.1 (per the test project's config.xml)   
  
  // From VS Package Manager Conole --&gt;
  Path 
  ----                          
  C:\Users\myusername\Documents\Visual Studio 2015\Projects\BlankCordovaApp3TestZ\BlankCordovaApp3TestZ // this is my new template test project
  
  PM&gt; node -v
  v6.9.1
  PM&gt; npm list cordova
  BlankCordovaApp3TestZ@1.0.0 C:\Users\myusername\Documents\Visual Studio 2015\Projects\BlankCordovaApp3TestZ\BlankCordovaApp3TestZ
  `-- (empty)
  
  PM&gt; npm list -g cordova
  C:\Users\myusername\AppData\Roaming\npm
  `-- cordova@7.0.1 
  
  PM&gt; cordova platform version android
  Installed platforms:
  
  Available platforms: 
    android ~6.2.2
    blackberry10 ~3.8.0 (deprecated)
    browser ~4.1.0
    webos ~3.7.0
    windows ~5.0.0
  </code></pre>
  
  <h3>Full BUILD Output (for DEBUG ANDROID DEVICE) --></h3>
  
  <pre><code>1&gt;------ Build started: Project: BlankCordovaApp3TestZ, Configuration: Debug Android ------
  1&gt;  ------ Ensuring correct global installation of package from source package directory: C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\APACHECORDOVATOOLS\packages\vs-tac
  1&gt;  ------ Name from source package.json: vs-tac
  1&gt;  ------ Version from source package.json: 1.0.42
  1&gt;  ------ Package not currently installed globally.
  1&gt;  ------ Installing globally from source package. This could take a few minutes...
  1&gt;  Each package is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may include dependencies which are governed by additional licenses. Follow the package source (feed) URL to determine any dependencies.
  1&gt;  ENOENT, no such file or directory ''
  1&gt;MSBUILD : cordova-build error : module.js:338
  1&gt;  module.js:338
  1&gt;MSBUILD : cordova-build error :  throw err;
  1&gt;      throw err;
  1&gt;MSBUILD : cordova-build error :  ^
  1&gt;            ^
  1&gt;MSBUILD : cordova-build error BLD401: Error : BLD00401 : Could not find module 'C:\Users\myusername\Documents\Visual Studio 2015\Projects\BlankCordovaApp3TestZ\BlankCordovaApp3TestZ\node_modules\vs-tac\app.js'. Please Go to Tools --&gt; Options --&gt; Tools for Apache Cordova --&gt; Cordova Tools --&gt; Clear Cordova Cache and try building again.
  1&gt;  Error Cannot find module 'C:\Users\myusername\Documents\Visual Studio 2015\Projects\BlankCordovaApp3TestZ\BlankCordovaApp3TestZ\node_modules\vs-tac\app.js'
  1&gt;MSBUILD : cordova-build error :  at Function.Module._resolveFilename (module.js:336:15)
  1&gt;      at Function.Module._resolveFilename (module.js:336:15)
  1&gt;MSBUILD : cordova-build error :  at Function.Module._load (module.js:278:25)
  1&gt;      at Function.Module._load (module.js:278:25)
  1&gt;MSBUILD : cordova-build error :  at Function.Module.runMain (module.js:501:10)
  1&gt;      at Function.Module.runMain (module.js:501:10)
  1&gt;MSBUILD : cordova-build error :  at startup (node.js:129:16)
  1&gt;      at startup (node.js:129:16)
  1&gt;MSBUILD : cordova-build error :  at node.js:814:3
  1&gt;      at node.js:814:3
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
  </code></pre>
  
  <p>New stuff I'm trying today --></p>
  
  <pre><code>npm config set prefix %APPDATA%\npm
  npm config set cache %APPDATA%\npm-cache
  </code></pre>
  
  <p>(because I also copied vs-tac into my roaming folder at some point)...this had no effect on build.</p>
  
  <p>Also, realized my config.xml had CLI set to 6.1.1, so i changed this to match the globally installed version, 7.0.1 - no effect on build.</p>
  
  <p>Any assistance much appreciated.</p>
  
  <p>Thanks in advance.</p>