2014-04-24 38 views
0

的高致病性禽流感模块的insatllation我想安装节点的高致病性禽流感模块,我使用下面的命令错误节点

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 

我能够安装其他模块,如请求& express,但在安装hapi时出错,如何解决错误

回答

0

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

编辑:我可以确认npm install hapi适用于节点v0.10.26。

+0

你能告诉我如何安装我试过的最新节点版本:sudo apt-get install nodejs – Mohit

+0

如果你在Ubuntu上,你可以使用[this ppa](https://launchpad.net/~chris-lea/ + archive/node.js /)以获得更新的稳定版本的节点(早在Ubuntu Lucid中)。如果你使用的是Debian,你可以从[wheezy-backports,jessie或sid]获得v0.10.26(https://packages.debian.org/search?keywords=nodejs&searchon=names&suite=all§ion=all)。 – mscdex

+0

解决了,我删除并安装了节点和npm的最新版本,然后尝试installin hapi模块,它的工作感谢您的帮助 – Mohit