“无法从注册表获取消息";在尝试安装任何模块时 [英] "message failed to fetch from registry" while trying to install any module

查看:62
本文介绍了“无法从注册表获取消息";在尝试安装任何模块时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从npm安装任何节点模块.

I can't install any node module from the npm.

npm install socket.io

以上命令导致以下输出,无法安装socket.io

The above command resulted to below output, it is not able to install socket.io

npm http GET https://registry.npmjs.org/socket.io

npm ERR! Error: failed to fetch from registry: socket.io
npm ERR!     at /opt/node0610/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/opt/node0610/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:32:9)
npm ERR!     at Request._callback (/opt/node0610/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:137:18)
npm ERR!     at Request.callback (/opt/node0610/lib/node_modules/npm/node_modules/request/main.js:109:22)
npm ERR!     at Request.<anonymous> (/opt/node0610/lib/node_modules/npm/node_modules/request/main.js:198:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/opt/node0610/lib/node_modules/npm/node_modules/request/main.js:195:10)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at CleartextStream.<anonymous> (http.js:1134:11)
npm ERR!     at CleartextStream.emit (events.js:67:17)
npm ERR! 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! 
npm ERR! System Linux 2.6.18-194.el5
npm ERR! command "node" "/opt/node0610/bin/npm" "install" "socket.io"
npm ERR! cwd /opt/node0610/lib/node_modules
npm ERR! node -v v0.6.10
npm ERR! npm -v 1.1.0-3
npm ERR! message failed to fetch from registry: socket.io
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /opt/node0610/lib/node_modules/npm-debug.log
npm not ok

我的NPM版本是:

[applmgr@dev node_modules]$ npm --version
1.1.0-3

我的NodeJS版本是:

My NodeJS Version is :

[applmgr@dev node_modules]$ node --version
v0.6.10

推荐答案

我必须执行以下命令:

npm config set registry http://registry.npmjs.org/

但是,这将使npm通过不安全的HTTP连接安装软件包.如果可以的话,您应该坚持使用

However, that will make npm install packages over an insecure HTTP connection. If you can, you should stick with

npm config set registry https://registry.npmjs.org/

代替通过HTTPS安装.

instead to install over HTTPS.

这篇关于“无法从注册表获取消息";在尝试安装任何模块时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆