【问题标题】:error in insatllation of hapi module of nodenode的hapi模块安装出错
【发布时间】:2014-05-12 23:38:21
【问题描述】:

我想使用以下命令安装节点的 hapi 模块

npm install hapi

我收到以下错误

npm http GET https://registry.npmjs.org/hapi

npm ERR! Error: failed to fetch from registry: hapi
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-     client/request.js:136:18)

npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:209:10)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at CleartextStream.<anonymous> (http.js:1137:11)
npm ERR!     at CleartextStream.emit (events.js:67:17)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/mohit/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "node" "/usr/bin/npm" "install" "hapi"
npm ERR! cwd /home/mohit
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: hapi
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/mohit/npm-debug.log
npm not ok

我可以安装其他模块,例如 request & express,但在安装 hapi 时出错,如何解决该错误

【问题讨论】:

    标签: linux node.js installation hapijs


    【解决方案1】:

    尝试升级 node.js。您使用的是非常旧的 v0.6.x,它使用的是旧版本的 npm。当前最新的 node 稳定版本(在撰写本文时)是 v0.10.26(随 npm 1.4.3 提供)。

    编辑:我可以确认 npm install hapi 与节点 v0.10.26 一起使用。

    【讨论】:

    • 你能告诉我如何安装我正在尝试的最新节点版本:sudo apt-get install nodejs
    • 如果你在 Ubuntu 上,你可以使用 this ppa 来获得更新的稳定版本的节点(早在 Ubuntu Lucid 上)。如果您使用的是 Debian,则可以从 wheezy-backports, jessie, or sid 获取 v0.10.26。
    • 已解决,我删除并安装了最新版本的 node 和 npm,然后尝试安装 hapi 模块,感谢您的帮助
    猜你喜欢
    • 1970-01-01
    • 2019-07-11
    • 1970-01-01
    • 1970-01-01
    • 2014-02-25
    • 1970-01-01
    • 2020-07-31
    • 2011-06-06
    • 2015-07-16
    相关资源
    最近更新 更多