npm安装快递给我校验错误

我有节点v.0.10.30和npm 1.4.21安装,当我执行这个命令

npm install express 

我得到这个结果

  Error: shasum check failed for /tmp/npm-4273-g1Rb0gCE/registry.npmjs.org/express/- /express-4.9.7.tgz npm ERR! Expected: ae3e0bdf0095749467fde125afd77e7988ff0fbb npm ERR! Actual: da39a3ee5e6b4b0d3255bfef95601890afd80709 npm ERR! From: https://registry.npmjs.org/express/-/express-4.9.7.tgz npm ERR! at /usr/lib/node_modules/npm/node_modules/sha/index.js:38:8 npm ERR! at ReadStream.<anonymous>(/usr/lib/node_modules/npm/node_modules/sha/index.js:85:7) npm ERR! at ReadStream.emit (events.js:117:20) npm ERR! at _stream_readable.js:938:16 npm ERR! at process._tickCallback (node.js:419:13) 

来自npm-debug.log文件的更多日志

 0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'express' ] 2 info using npm@1.4.21 3 info using node@v0.10.30 4 verbose node symlink /usr/bin/node 5 warn package.json app@0.0.0 No description 6 warn package.json app@0.0.0 No repository field. 7 warn package.json app@0.0.0 No README data 8 verbose readDependencies using package.json deps 9 verbose cache add [ 'express', null ] 19 verbose lock express@ /home/wilson/.npm/64a534c1-express.lock 20 silly addNameRange { name: 'express', range: '*', hasData: false } 21 verbose request where is /express 22 verbose request registry https://registry.npmjs.org/ 23 verbose request id a071fcd68daa94eb 24 verbose url raw /express 25 verbose url resolving [ 'https://registry.npmjs.org/', './express' ] 26 verbose url resolved https://registry.npmjs.org/express 27 verbose request where is https://registry.npmjs.org/express 28 info trying registry request attempt 1 at 20:00:01 29 verbose etag "7FVLRT9Y9RQJKGVQC7099FKQ4" 30 http GET https://registry.npmjs.org/express 31 http 304 https://registry.npmjs.org/express 32 silly registry.get cb [ 304, 32 silly registry.get { date: 'Sat, 11 Oct 2014 00:00:01 GMT', 32 silly registry.get server: 'Apache', 32 silly registry.get via: '1.1 varnish', 32 silly registry.get 'last-modified': 'Fri, 10 Oct 2014 23:59:57 GMT', 32 silly registry.get 'cache-control': 'max-age=60', 32 silly registry.get etag: '"7FVLRT9Y9RQJKGVQC7099FKQ4"', 32 silly registry.get 'x-served-by': 'cache-iad2130-IAD', 32 silly registry.get 'x-cache': 'HIT', 32 silly registry.get 'x-cache-hits': '2', 32 silly registry.get 'x-timer': 'S1412985601.881420,VS0,VE0', 32 silly registry.get vary: 'Accept', 32 silly registry.get 'content-length': '0', 32 silly registry.get 'keep-alive': 'timeout=10, max=50', 32 silly registry.get connection: 'Keep-Alive' } ] 33 verbose etag https://registry.npmjs.org/express from cache 34 silly addNameRange number 2 { name: 'express', range: '*', hasData: true } 

我的操作系统是Ubuntu 14.04 npm命令build议我在npm的github存储库中报告这个日志

       

网上收集的解决方案 "npm安装快递给我校验错误"

下载文件https://registry.npmjs.org/express//express-4.9.7.tgz

然后从文件安装

 npm install ./express-4.9.7.tgz 

当您在执行安装时没有访问系统的根pipe理员时,通常会出现这些错误消息中的一部分。

当我打开terminal并运行$ sudo -i来访问#root,然后input$ npm install express ,它已正确安装。 希望这有助于!

我有一个类似的问题,这是由于下载的损坏。

通过清除caching中的违规软件包并重新运行安装很容易解决。

 $ npm cache clean express $ npm i express 

(在我的情况下,损坏的软件包是一个依赖项,所以我从caching中清除了它,而不是我试图安装的软件包)

首先以administrator身份启动命令提示符,然后运行命令。