node.js - Npm 错误 - Windows NT - 如何解决

标签 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>

怎么了?我不能使用 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/

相关文章:

node.js - Mongoose 中的最小和最大数量验证

node.js - 如何从浏览器链接启动/关注 Electron 应用程序?

javascript - 本地 gulp 安装后缺少 node_modules

javascript - "angular2-image-upload"npm 库 CORS 错误

javascript - 无法使用 npm 和 webpack 设置 NODE_ENV=production

node.js - NPM 安装错误(Angular 6)

node.js - NPM: "npm link"后找不到模块

node.js - 监控运行到 Windows Azure 中的 Node.js 应用程序

javascript - 如何在 Node.js 中使用 Lua 脚本将多条记录插入 Redis 哈希

node.js - Passport.socketio 一直说 - 连接到 socket.io : No session found 失败