I'm experiencing errors while building from a blank Cordova app with VS2013 update 4.
After I've installed CTP3.1, I went through the steps to build just a blank app using Cordova. However, none of these times have I been able to build a successful working application.
Error message shown as below:
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : fs.js:438 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : ^ 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : Error: ENOENT, no such file or directory 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\node_modules\vs-mda\lib\BuildSettings.js' 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : at Object.fs.openSync (fs.js:438:18) 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : at Object.fs.writeFileSync (fs.js:977:15) 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : at C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\xoxorie2.tv3\packages\vs-mda\install.js:62:16 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : at Array.forEach (native) 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : at copyFiles (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\xoxorie2.tv3\packages\vs-mda\install.js:59:17) 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : at ChildProcess. (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\xoxorie2.tv3\packages\vs-mda\install.js:98:13) 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : at ChildProcess.emit (events.js:98:17) 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(207,5): error : at Process.ChildProcess._handle.onexit (child_process.js:810:12) 1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets(219,5): error : Error installing local npm package.
Additional steps I have taken to solve the problem (according to the search results from Google):
- Repairing CTP3.1 tools
- Reinstalling CTP3.1
- Clear cordova cache from tools>options
- Clean the solution
- use "npm install -g (full path to packages)/vs-mda" with admin command prompt
- move vs-mda folder manually to node_modules of project folder and %AppData%\Roaming\npm\node_modules respectively
Then I checked the diagnostic log. I have found that Visual Studio (VS) is calling vs-cli.cmd in an incorrect directory, which is (VS install directory\Common7\IDE).
What I did next is modify the NpmInstallDir from Microsoft.MDA.targets. which is extending NpmInstallDir by (Extensions\xoxorie2.tv3\packages) as vs-cli.cmd is in that directory.
Then I rebooted VS, cleaned the solution, and it seemed that this issue may have been resolved.
However, when I choose:
Ripple emulator
Although the error message above disappeared, and a new Chrome browser window is opened, the application reports a connection error and VS window hangs for some time. After a while of hanging, the VS console output reports:
Unable to get Ripple session info for port 9223 because Visual Studio is running in elevated mode. Please close all instances of Chrome and restart Visual Studio in the regular user mode.
when I choose:
Device or Android Emulator
Error 3 ------ Unable to copy file c:\BlankCordovaApp1\BlankCordovaApp1\node_modules\vs-mda\node_modules\cordova\node_modules\cordova-lib\node_modules\cordova-js\node_modules\browserify\node_modules\browser-pack\node_modules\combine-source-map\node_modules\convert-source-map.npmignore to www\node_modules\vs-mda\node_modules\cordova\node_modules\cordova-lib\node_modules\cordova-js\node_modules\browserify\node_modules\browser-pack\node_modules\combine-source-map\node_modules\convert-source-map.npmignore The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters c:\BlankCordovaApp1\BlankCordovaApp1\MDAVSCLI 1 1 BlankCordovaApp1
It does matter if I change the build mode (Debug, Release or Distribution) as I have the same result.
As what I've mentioned above, what I really want to ask are:
- I can't see the need to change the Microsoft.MDA.targets file. Why don't others have to modify this file to lead to a success build?
- How to solve the hanging issue of Ripple emulator?
- How to solve building failure due to long directory name issue? (I just wanna say limiting directory name is a stupid limitation made by Microsoft)
These errors have bothered me for several days, I'm really getting mad.
Therefore hope someone can help me with these problem. Any help would be greatly appreciated.