node.js Hello World 失败

标签 node.js express

伙计们,请按照 http://expressjs.com/guide.html 上的指南进行操作,尝试安装 package.json 时出现以下错误

$猫包.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!     <npm-@googlegroups.com>

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

$cat npm-debug.log

1023 info postuninstall express@3.4.0
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     <npm-@googlegroups.com>
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 和 Node 版本:

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

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

最佳答案

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

关于node.js Hello World 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19060744/

相关文章:

javascript - 路由整个文件夹及其内容

node.js - MongoServerError:聚合期间的 PlanExecutor 错误::由::'newRoot' 表达式引起,表达式必须计算为对象

node.js - 如何更改 Firebase 中的正文解析器限制?

node.js - 测试包含异步调用的函数

node.js - 发送 POST 请求时 Nodejs 请求 promise 错误?

node.js-找不到模块请求 : Windows

node.js - 使用 Node.js 通过自定义 API 向设备(ios 或 android)发送通知

node.js - 使用 mongoose 根据条件 mongodb 填充或不填充

javascript - 如何使用 http 传递整个 URL,例如 "http://www.facebook.com"作为 Node/express "/:param"的参数?

node.js - MS Bot 框架 v4 - 无法将 QnA 生成器添加到机器人 - 主机名加密值不是有效格式