Npm错误 - Windows NT - 如何解决

Smi*_*tha 8 node.js npm

我尝试npm install时出现以下错误:

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.10.36
npm ERR! npm  v2.12.1

npm ERR! Cannot read property 'latest' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.10.36
npm ERR! npm  v2.12.1

npm ERR! Cannot read property 'latest' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.10.36
npm ERR! npm  v2.12.1

npm ERR! Cannot read property 'latest' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
Run Code Online (Sandbox Code Playgroud)

怎么了?我不能使用nodejs <0.10.36或> 0.11

Ank*_*nna 6

更改缓存的位置.这肯定会奏效.默认情况下,NPM尝试从缓存中拾取包,并且有时禁止默认位置读取.

npm config set cache C:\ Dev \nodejs \npm-cache --global

干杯!


Ank*_*aha 5

更新npm为我解决了这个问题。 npm install -g npm


Sco*_*Izu 2

您可能想要指向本地注册表或防火墙后面的注册表

npm install --registry http://npm.myserver.com
Run Code Online (Sandbox Code Playgroud)