npm install express给我校验和错误

时间:2014-10-10 23:42:35

标签: javascript node.js 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命令建议我在npm&#39; github存储库

中报告此日志

4 个答案:

答案 0 :(得分:9)

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

然后从文件

安装
npm install ./express-4.9.7.tgz

答案 1 :(得分:3)

当您在执行安装时未访问系统的根管理员时,通常会出现其中一些错误消息。

当我打开终端并运行$ sudo -i以访问#root然后输入$ npm install express时,它已正确安装。希望这有帮助!

答案 2 :(得分:3)

我遇到类似的问题,这是由于下载损坏造成的。

通过从缓存中清除违规包并重新运行安装,可以轻松解决这个问题。

$ npm cache clean express
$ npm i express

(在我的情况下,损坏的包是一个依赖项,所以我从缓存中清除它,当然不是我试图安装的包)

答案 3 :(得分:0)

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