npm install mongoose:shasums.txt缺失

时间:2015-10-17 17:54:11

标签: node.js mongoose npm

我正在尝试安装Mongoose,但它失败了。

npm install mongoose --save

这是错误:

> kerberos@0.0.15 install D:\Hans\Playground\MultiVision\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos
> (node-gyp rebuild) || (exit 0)
D:\Hans\Playground\MultiVision\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos>node "c:\Dev\nodist\bin\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp http GET http://nodejs.org/dist/v4.2.1/node-v4.2.1.tar.gz
gyp http 200 http://nodejs.org/dist/v4.2.1/node-v4.2.1.tar.gz
gyp http GET http://nodejs.org/dist/v4.2.1/SHASUMS.txt
gyp http GET http://nodejs.org/dist/v4.2.1/SHASUMS.txt
gyp http GET http://nodejs.org/dist/v4.2.1/node.lib
gyp http GET http://nodejs.org/dist/v4.2.1/x64/node.lib
gyp http GET http://nodejs.org/dist/v4.2.1/x64/node.lib
gyp http GET http://nodejs.org/dist/v4.2.1/node.lib
gyp http 404 http://nodejs.org/dist/v4.2.1/SHASUMS.txt
gyp WARN install got an error, rolling back install
gyp http 404 http://nodejs.org/dist/v4.2.1/x64/node.lib
gyp http 404 http://nodejs.org/dist/v4.2.1/SHASUMS.txt
gyp http 404 http://nodejs.org/dist/v4.2.1/x64/node.lib
gyp http 404 http://nodejs.org/dist/v4.2.1/node.lib
gyp http 404 http://nodejs.org/dist/v4.2.1/node.lib
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading SHASUMS.txt
gyp ERR! stack     at Request.<anonymous> (c:\Dev\nodist\bin\node_module\npm\node_modules\node-gyp\lib\install.js:316:18)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onResponse (c:\Dev\nodist\bin\node_modules\npm\node_modules\request\request.js:832:10)
gyp ERR! stack     at ClientRequest.g (events.js:260:16)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! stack     at ClientRequest.emit (events.js:169:7)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (_http_client.js:415:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at Socket.socketOnData (_http_client.js:305:20)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "c:\\dev\\nodist\\v-x64\\nodev4.2.1\\node.exe" "c:\\Dev\\nodist\\bin\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Hans\Playground\MultiVision\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok

似乎gyp正在寻找合适的地方,但不知何故预计错误的文件......

http://nodejs.org/dist/v4.1.2/ =&gt; SHASUMS256.txt

http://nodejs.org/dist/v0.12.7/ =&gt; SHASUMS.txt

1 个答案:

答案 0 :(得分:2)

随着Node的4.x分支的发布,校验和文件命名约定发生了变化,并且SHASUMS256.txt文件被追溯地添加到旧版本的存储库中,以保持向后兼容性。但是,删除了SHASUMS.txt文件,结果是NPM的后Node-4.x版本能够与旧版本的Node一起正常工作,但NPM的前Node-4.x版本在工作时产生404错误使用较新版本的Node。

简而言之,将您的NPM实例更新为在节点4之后或之后发布的版本,例如最新版本:

npm install npm@latest -g