Installing cordova using cmd , gives error

2019-09-19 04:13发布

问题:

I have installed node-js and set path to the bin folder, using Windows 7 . using cmd , i am installing cordova, with following command.

npm install -g cordova

it gives the following error,

C:\Users\admin>npm install -g cordova
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4

npm ERR! shasum check failed for C:\Users\admin\AppData\Local\Temp\npm-27416-181
c77ac\registry.npmjs.org\cordova-app-hello-world\-\cordova-app-hello-world-3.9.0
.tgz
npm ERR! Expected: 5866d8fed5582686c68ec59a6d1097c4ec0fcc4b
npm ERR! Actual:   33c6d47bbc528da2c1b9b8e6ae592c2f5dba371f
npm ERR! From:     https://registry.npmjs.org/cordova-app-hello-world/-/cordova-
app-hello-world-3.9.0.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\admin\npm-debug.log

How to get resolve the problem ?

回答1:

You need to Run as Administrator. Right click CMD and choose Run as Administrator. For mac, using this command, sudo npm install -g cordova.



回答2:

Try using npm I -g cordova --verbose. It will log all the things in console. Watch it for any specific error. Where its struck.