Reputation: 29
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):
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:
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.
Upvotes: 1
Views: 998
Reputation: 1742
I'm also new to Cordova in Visual Studio, I got many, many, just too many problems compiling the project. After many tries, if I use any user names with SPACE to login Windows 7, for example, "Kenneth Li" and install CTP3.1, the build fails.
Then I create another user in Windows 7, e.g. "Ken" or "Administrator", and uninstall/reinstall CTP3.1, the build success, I don't know why! Everything in the project is the same, except the user name login is different!
By the way, may be, just may be, the path to your project should NOT contain any SPACE as well, let me know if this is the cause of the problem.
Updated 2015/05/04:
Hi hcw,
I guess (from your logo) u are a developer from HK, same as me. I tried Cordova in Visual Studio in 3 platforms: 1. Windows 7 Ultimate 64-bits. 2. Windows 8.1 Ultimate 64-bits. 3. Windows Server 2012 R2.
The intallation procedures are striagt forward without any problem in Windows 7 and Windows Server 2012 R2. In Windows 8.1, I found in quite rare, I list my procedures as follow:
Install Windows 8.1
In control panel "Program and function", turn on all functions related to ".NET 3.5"
Install all applications that require .NET 3.5, e.g. Office 2010, SQL Server 2008, CorelDraw x6 ......
If I try to install vs_community.exe (i.e. Visual Studio 2013 Communiy with Update 4) now, the installation exe cannot be opened. I have to turn off .NET 3.5 inside the control panel.
After turning off .NET 3.5, I am unable to turn it on again! (this is why I need to install all applications require .NET 3.5 before installing vs_community.exe.
Now I can install vs_community.exe without any problem.
If I am in Hong Kong, then I install vs2013mda_0.3.1.exe(i.e. the Cordova for Visual Studio CTP 3.1), this step takes me around 1 to 2 hours. However, if I'm in China, I need to use a VPN to connect to HK first, otherwise the vs2013mda_0.3.1.exe cannot be installed successfully, I guess the problem is China blocked some urls that vs2013mda_0.3.1.exe requires, so if I'm in China, this step takes me around 6 to 8 hours since the vpn is slow.
Now I can create a blank Cordova project and compile without any error. However, this Windows 8.1 machince can NEVER install any other applications that require .NET 3.5
Upvotes: 0