Mathee Mathee - 1 year ago 126
Android Question

Cordova Installation issue :not installed properly and cordova command is working only on c:\>

I followed
and to install cordova.
I have node 4.4.5 version.

When I gave the command C:>npm install -g cordova below are created in C drive seperately (not inside a one folder)


  • node_modules (folder)

  • cordova (win command script)

  • cordova (file)

I also get bellow errors,

npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"}
(current: {"node":"4.4.5","npm":"2.15.5"})
npm WARN deprecated lodash-node@2.4.1: This package has been discontinued
in favor of lodash@^4.0.0.

when I type C:>cordova, it respnds the command. cordova version installed is 6.2.0

But if I call cordova in other directory
eg: C:\CordovaProjects>cordova

then cordova command "is not recognized as an internal or external command"

What I am I doing wrong?



C:\Users\MatheeshaF>npm config list
; cli configs
user-agent = "npm/2.15.5 node/v4.4.5 win32 x64"

; userconfig C:\Users\MatheeshaF\.npmrc
prefix = "C:\\"

; builtin config undefined

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\Users\MatheeshaF
; HOME = C:\Users\MatheeshaF
; 'npm config ls -l' to show all defaults.

with help of comments I managed to create a project. still cannot add platform.
Get below errors,

C:\CordovaProjects\TestApp>cordova platform add android
Error: Failed to fetch platform android
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: connect EACCES

Dar Dar
Answer Source

Your npm prefix is not set properly.

  1. Run npm bin -g and npm config get prefix
  2. If there is a result other than C:\\, add this to your path

It should look similar to this


You can refer here how to do it in windows 10

For Windows 10,

Settings > System > About > System Info > Environmental Variables 

Edit path and append %USERPROFILE%\AppData\Roaming\npm at the end

  1. set your npm prefix by npm config set prefix %USERPROFILE%\AppData\Roaming\npm
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download