问题
I did the full installation of VS 2015 Enterprise + Tools for Apache Cordova. When I open or create any project It won't build and even show the Ripple Emulator or Device information on the Run button.
I already did a full reinstall and still the same.
When I click the Dependency Check button at the Configuration Window says everything is OK.
When I try to build:
npm ERR! Windows_NT 6.3.9600 1> npm ERR! argv "node" "C:\Users\%UserProfile%\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "-g" "install" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac" "--loglevel" "warn" 1> npm ERR! node v0.12.2 1> npm ERR! npm v2.12.0 1> npm ERR! undefined is not a function 1> npm ERR! 1>RUNMDAINSTALL : npm ERR! If you need help, you may report this error at: 1> npm ERR! https://github.com/npm/npm/issues 1> npm ERR! Please include the following file with any support request: 1> npm ERR! C:\Users\%UserProfile%\Documents\Visual Studio 2015\Projects\BlankCordovaApp10\BlankCordovaApp10\npm-debug.log 1> ------ npm install failed. Exit code: 1 1> ------ Package installation failed. Retrying... 1> npm WARN uninstall not installed in C:\Program Files (x86)\nodejs\node_modules: "vs-tac" 1> npm ERR! Windows_NT 6.3.9600 1> npm ERR! argv "node" "C:\Users\%UserProfile%\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "-g" "install" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac" "--loglevel" "warn" 1> npm ERR! node v0.12.2 1> npm ERR! npm v2.12.0 1> npm ERR! undefined is not a function 1> npm ERR! 1>RUNMDAINSTALL : npm ERR! If you need help, you may report this error at: 1> npm ERR! https://github.com/npm/npm/issues 1> npm ERR! Please include the following file with any support request: 1> npm ERR! C:\Users\%UserProfile%\Documents\Visual Studio 2015\Projects\BlankCordovaApp10\BlankCordovaApp10\npm-debug.log 1> ------ npm install failed. Exit code: 1 1> ------ Package installation failed. Retrying... 1> npm WARN uninstall not installed in C:\Program Files (x86)\nodejs\node_modules: "vs-tac" 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets(287,5): error : Error installing local npm package. 1>MSBUILD : cordova-build error BLD401: Error : BLD00401 : Could not find module 'C:\Users\%UserProfile%\AppData\Roaming\npm\node_modules\vs-tac\app.js'. Please Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and try building again.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I did clean the cache using the Configuration button but still the same. When a run npm cache clear
the package install, but the Run Button don't show device information as I said before.
EDIT:
@Subhag Oak Thank you! This brought back the menu options from Run button, but still errors when I try to Run/Build:
------ npm install of vs-tac@1.0.0 from C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\APACHECORDOVATOOLS\packages\vs-tac completed. 1>MSBUILD : cordova-build error BLD401: Error : BLD00401 : Could not find module 'C:\Users\FilipeAugusto\AppData\Roaming\npm\node_modules\vs-tac\app.js'. Please Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and try building again. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
回答1:
We think, we have a workaround for this. Can you try the following solution:
- Close all VS instances
- cd "%localappdata%\Microsoft\Phone Tools"
- rename CoreCon folder
- Launch VS again.
Let us know if this fixes the issue?
回答2:
I solved this issue with this steps:
1. Copy vs-tac
folder from: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\Packages\
to the AppData roaming folder.
- I opened a VS 2015 Developer Prompt to the AppData\roaming folder where I had copied the
vs-tac
package and runnpm install
回答3:
To fix This problem close VS first then copy folder vs-tac from
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\Packages\
To
C:\Users\ASUS S550C\AppData\Roaming\npm\node_modules
Then if you cannot see folder named cordova in new path
1- open CMD or Termianl and Write
cd C:\Users\ASUS S550C\AppData\Roaming\npm\node_modules
npm install -g cordova
2- Then write
cd C:\Users\ASUS S550C\AppData\Roaming\npm\node_modules\cordova
npm install
This will fix the problem
Note: to use npm you need to install Node.js
回答4:
Started this by globally installing Cordova and then the vs-tac which seemed to be missing (not sure global installation of Cordova is required though). Info from here (https://social.msdn.microsoft.com/Forums/en-US/4f97d8c5-6069-49ee-a065-283741fd483f/unable-to-build-my-first-cordova-app-in-vs-2015?forum=ToolsForApacheCordova):
npm install -g cordova
npm install -g "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac"
Then it was giving the following error:
EXDEV, cross-device link not permitted
Luckily there is guidance on how to solve this (https://stackoverflow.com/a/30958837/2270404):
C:\Temp>git clone https://github.com/phonegap/phonegap-plugin-fast-canvas.git
Then go to the project folder and run the following:
cordova plugin add C:\Temp\phonegap-plugin-fast-canvas\
And it's working!
来源:https://stackoverflow.com/questions/31679802/visual-studio-2015-wont-work-with-tools-for-apache-cordova