当前位置: 首页 > 面试题库 >

尝试安装任何模块时出现“无法从注册表获取消息”

宓文斌
2023-03-14
问题内容

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

npm install socket.io

上面的命令导致下面的输出,它无法安装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版本是:

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

问题答案:

https://github.com/isaacs/npm/issues/2119

我必须执行以下命令:

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

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

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

而是通过HTTPS安装。



 类似资料:
  • 我无法从NPM安装任何节点模块。 上面的命令导致了下面的输出,它无法安装socket.io

  • 以下是从终端返回的确切消息: 错误:安装sass时出错:错误无法生成gem本机扩展。当前目录:/Library/Ruby/Gems/2.0。0/gems/ffi-1.9。18/ext/ffi_c/System/Library/Frameworks/Ruby。framework/Versions/2.0/usr/bin/ruby-r/siteconf20170721-3751-3vsh43。rb e

  • 我正在使用learnyounode教程学习node.js。好几次它都要求我安装类似bl、通过2-map等的东西。每次我键入:npm install通过2-map--保存 它将运行几分钟,然后抛出此错误 我试图遵循这个stackoverflow建议,npm安装不起作用,但那不起作用。那么,有人能帮我解决如何设置我的npm,以便我可以安装这些模块吗。谢谢

  • 问题内容: 我正在启动我的第一个Node.js服务器。我正在尝试遵循Node.js中的教程。 安装完Node.js并执行后,下一条指令是通过运行启动服务器,这将产生以下错误: 似乎它需要一个名为express的模块,因此我环顾四周,找到了可以解决此问题的命令。但是,出现以下错误: 问题答案: 对于以前跑步的人来说,似乎可以解决该问题

  • 本文向大家介绍uwp 取消注册任务,包括了uwp 取消注册任务的使用技巧和注意事项,需要的朋友参考一下 示例            

  • 问题内容: 我在Bower注册我的bower.json文件时遇到问题。任何帮助将不胜感激。 当我尝试使用Bower注册我的项目时 我收到错误消息: 我的bower.json的内容很简单(为了解决问题,我删除了空格和换行符): (请注意,该文件中没有?) 这是我运行Bower Register时屏幕上显示的详细信息: 问题答案: 您的Bower json文件(在此处可见:https : //raw.