当我尝试 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>
怎么了?我不能使用 nodejs < 0.10.36 或 > 0.11
最佳答案
更改您的缓存位置。这肯定会奏效。默认情况下,NPM 会尝试从缓存中获取包,并且默认位置有时会被禁止读取。
npm 配置设置缓存 C:\Dev\nodejs\npm-cache --global
干杯!
关于node.js - Npm 错误 - Windows NT - 如何解决,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32965938/