Davinder
Davinder

Reputation: 1

While running command npm install -g cordova in cli getting error in windows

c:>npm install -g cordova

npm ERR! fetch failed https://registry.npmjs.org/dep-graph/-/dep-graph-1.1.0.tgz

npm ERR! fetch failed https://registry.npmjs.org/npmconf/-/npmconf-0.1.16.tgz
npm ERR! fetch failed https://registry.npmjs.org/rc/-/rc-0.3.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/xcode/-/xcode-0.6.6.tgz
npm ERR! fetch failed https://registry.npmjs.org/dep-graph/-/dep-graph-1.1.0.tgz

npm ERR! fetch failed https://registry.npmjs.org/xcode/-/xcode-0.6.6.tgz
npm ERR! fetch failed https://registry.npmjs.org/npmconf/-/npmconf-0.1.16.tgz
npm ERR! fetch failed https://registry.npmjs.org/rc/-/rc-0.3.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/xcode/-/xcode-0.6.6.tgz
npm ERR! fetch failed https://registry.npmjs.org/rc/-/rc-0.3.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/dep-graph/-/dep-graph-1.1.0.tgz

npm ERR! fetch failed https://registry.npmjs.org/npmconf/-/npmconf-0.1.16.tgz
npm ERR! Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR!     at SecurePair.<anonymous> (tls.js:1365:32)
npm ERR!     at SecurePair.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:977:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:323:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR!     at doWrite (_stream_writable.js:226:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:216:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR!     at write (_stream_readable.js:585:24)
npm ERR!     at flow (_stream_readable.js:594:7)
npm ERR!     at Socket.pipeOnReadable (_stream_readable.js:626:5)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova"
npm ERR! cwd c:\
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! Error: EPERM, open 'c:\npm-debug.log'
npm ERR!  { [Error: EPERM, open 'c:\npm-debug.log'] errno: 50, code: 'EPERM', pa
th: 'c:\\npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova"
npm ERR! cwd c:\
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path c:\npm-debug.log
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, open 'c:\npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     c:\npm-debug.log
npm ERR! not ok code 0

I tried below command in cli

c:>npm config set strict-ssl false

and then executed command

c:>npm install -g cordova

It gives following result

C:\Users\e01005\AppData\Roaming\npm\cordova -> C:\Users\e01005\AppData\Roaming\n
pm\node_modules\cordova\bin\cordova
[email protected] C:\Users\e01005\AppData\Roaming\npm\node_modules\cordova
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], semver@2.
0.11, [email protected], [email protected], [email protected], [email protected], elemen
[email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
, [email protected])

and when I run command cordova create hello com.example.hello HelloWorld

it says

'cordova' is not recognized as an internal or external command, operable program or batch file.

I not getting whats the issue why it not allow me to create the projects some time it create project but not allow to add platform.

Environment variable PATH value is

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\adt-bundle-windows-x86_64-20130729\sdk\tools;C:\Program Files (x86)\adt-bundle-windows-x86_64-20130729\sdk\platform-tools;C:\Program Files\nodejs\

Upvotes: 0

Views: 3428

Answers (2)

Tirtha R
Tirtha R

Reputation: 1318

Install git before installing Cordova. In the background, it downloads from Git.

Upvotes: 0

Rafael
Rafael

Reputation: 11

I had the same problem and using

npm install -g phonegap

npm fetched and installed cordova successfully

Upvotes: 1

Related Questions