Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 preview - Apache Cordova Build Error

When I am tried to build apache cordova application in Visual Studio 2015 Preview I am experiencing following error.

npm install error : error : spawn ENOENT

But in Command prompt if i use

npm -v

Its returning

2.1.9

But when visual studio trying to install npm I am getting error.

Can any one help me on this?

Thanks.

Hi all,

After done the steps told by Ellen. Visual Studio reported New Error message

1>Task "MdaVsCli" (TaskId:17)
1>  Task Parameter:VsCliPath= C:\Users\MyName\AppData\Roaming\npm\node_modules\vs-mda\vs-cli.cmd (TaskId:17)
1>  Task Parameter:Platform=Android (TaskId:17)
1>  Task Parameter:ProjectDir=. (TaskId:17)
1>  Task Parameter:Configuration=Debug (TaskId:17)
1>  Task Parameter:ProjectName=BlankCordovaApp21 (TaskId:17)
1>  Task Parameter:Language=en-US (TaskId:17)
1>  Task Parameter:BuildTarget=RippleNexus (TaskId:17)
1>  The system cannot find the path specified. (TaskId:17)
1>Done executing task "MdaVsCli" -- FAILED. (TaskId:17)

The following are the message after i had installed npm.

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\xxl33
z1o.sqb\packages\vs-mda>npm -g install
npm WARN engine [email protected]: wanted: {"node":">=0.6","npm":"1"} (current: {"node":
"0.10.33","npm":"2.1.9"})
npm WARN engine [email protected]: wanted: {"node":">=0.6","npm":"1"} (current: {"node":
"0.10.33","npm":"2.1.9"})
C:\usr\local\vs-cli -> C:\usr\local\node_modules\vs-mda\vs-cli.cmd
[email protected] C:\usr\local\node_modules\vs-mda
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], forever-agent
@0.5.2, [email protected], [email protected], [email protected], [email protected], [email protected].
1, [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], acc
[email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], cordova-li
[email protected], [email protected])

I dont know why vs-cli looking in to wrong directory.

C:\usr\local\vs-cli

But the npm actually installed in the following directory

C:\Program Files\nodejs\node_modules\npm

Anyone help me on this.

Thanks

like image 311
Gowtham Avatar asked Nov 24 '14 16:11

Gowtham


1 Answers

It would be helpful to see a more verbose build output. You can set your build output to diagnostic (Tools\Options\Projects and Solutions\Build and Run\MSBuild project build output verbosity).

Try clearing your Cordova Cache from within VS under Tools\Options\Tools for Apache Cordova\Cordova Tools. After you have done that, re-open your project and attempt a clean build.

If you are still encountering issues at that point, you can attempt to manually install vs-mda using node following the instructions below.

Look for the packages folder under your VS install folder which contains vs-mda (the path will be something like this below. Note that the name of the highlighted folder will be unique to your system).

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\wgy514he.01m*\packages\vs-mda
  • Note that wgy514he.01m will not be the exact folder name, but look for something like it that contains the packages folder.

Then from an admin command prompt, run the command below. Note that it’s necessary to give the explicit path to the vs-mda folder under the VS installation path when issuing the command.

npm –g install <full path to packages folder>\vs-mda

If this install was successful, you should then be able to build your Cordova project. Let me know if this unblocks you. If this wasn’t successful, please pass along the results of the npm install command.

like image 102
Ellen Avatar answered Oct 08 '22 11:10

Ellen