Npm错误: - Windows NT - 如何解决

时间:2016-09-22 06:20:41

标签: node.js npm npm-install

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

E:\project\nodeJS\sws-nodejs-angular>npm install
npm WARN install Couldn't install optional dependency: Unsupported
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 v5.0.0
npm ERR! npm  v3.3.6
npm ERR! Cannot read property 'localeCompare' 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! Please include the following file with any support request:
npm ERR!     E:\project\nodeJS\sws-nodejs-angular\npm-debug.log

1 个答案:

答案 0 :(得分:0)

您提到的上一条消息

npm WARN install Couldn't install optional dependency: Unsupported
运行install时会打印

它调用npm-cli.js并使用deps.js加载依赖项(loadDeps)。

它检查错误并调用function andHandleOptionalErrors这似乎在这里失败,因为isFatal很可能是True

var isFatal = failedDependency(tree, name)

之后它会写出您之前看到的错误

对于每个依赖项,它检查并运行function andForEachChild,它似乎调用localeCompare来检查包依赖性

return aa[1].package.name.localeCompare(bb[1].package.name)

我不确定,但是从您的语言环境解析的可选依赖项可能与Windows_NT 6.1.7601有关,而deps.js正在调用log来打印"ERR!"输出。由于不支持依赖项,可能未定义package.name

tldr;不支持操作系统或其他依赖项。