2013-09-27 41 views
3

伙计们,继http://expressjs.com/guide.html的指南时,我收到以下错误尝试安装的package.jsonNode.js的世界你好失败

$猫的package.json

{ 
    "name": "hello-world", 
    "description": "hello world test app", 
    "version": "0.0.1", 
    "private": true, 
    "dependencies": { 
    "express": "3.x" 
    } 
} 

$ NPM安装

npm ERR! Error: shasum check failed for /home/ec2-user/tmp/npm-18638-pXExv-yX/1380319074710-0.009542229119688272/tmp.tgz 
npm ERR! Expected: 35a31834323578ee65f5d870568097914739cf4e 
npm ERR! Actual: fe233616bad951a995b6941c3b76d13d3d074e09 
npm ERR!  at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8 
npm ERR!  at ReadStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7) 
npm ERR!  at ReadStream.EventEmitter.emit (events.js:125:20) 
npm ERR!  at _stream_readable.js:896:16 
npm ERR!  at process._tickCallback (node.js:316:11) 
npm ERR! If you need help, you may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Linux 3.4.43-43.43.amzn1.x86_64 
npm ERR! command "node" "/usr/local/bin/npm" "install" 
npm ERR! cwd /home/ec2-user/hello-world 
npm ERR! node -v v0.11.8-pre 
npm ERR! npm -v 1.3.11 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /home/ec2-user/hello-world/npm-debug.log 
npm ERR! not ok code 0 

$猫NPM-的debug.log

1023 info postuninstall [email protected] 
1024 error Error: shasum check failed for /home/ec2-user/tmp/npm-18638-pXExv-yX/1380319074710-0.009542229119688272/tmp.tgz 
1024 error Expected: 35a31834323578ee65f5d870568097914739cf4e 
1024 error Actual: fe233616bad951a995b6941c3b76d13d3d074e09 
1024 error  at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8 
1024 error  at ReadStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7) 
1024 error  at ReadStream.EventEmitter.emit (events.js:125:20) 
1024 error  at _stream_readable.js:896:16 
1024 error  at process._tickCallback (node.js:316:11) 
1025 error If you need help, you may report this log at: 
1025 error  <http://github.com/isaacs/npm/issues> 
1025 error or email it to: 
1025 error  <[email protected]> 
1026 error System Linux 3.4.43-43.43.amzn1.x86_64 
1027 error command "node" "/usr/local/bin/npm" "install" 
1028 error cwd /home/ec2-user/hello-world 
1029 error node -v v0.11.8-pre 
1030 error npm -v 1.3.11 
1031 verbose exit [ 1, true ] 

当前NPM和节点版本:

$npm -version 
1.3.11 
$node --version 
v0.11.8-pre 

任何帮助将不胜感激!谢谢!

+0

你可以试试npm install -g express,让我知道它是否工作或引发错误... – Thalaivar

+0

将节点降级到v0.10.19固定此 – Cmag

回答

2

将节点降级到v0.10.19解决了这个问题。

+0

即将添加评论,但不确定....是否这是问题...很酷... +1 ...回答它 – Thalaivar

+1

其实更进一步,v0.10.17解决了一些其他问题:) – Cmag

0

我注意到我需要“版本”中的3个组件。所以

"express": "3.x.x" 

会工作。