为以太坊安装 web3js 时出错/无法连接到 github.com



我正在使用npm来安装web3js:

npm install web3

它最终失败了。这是我得到的输出...

npm WARN deprecated tar.gz@1.0.7: â ï¸  WARNING â ï¸ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git
npm ERR!
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.255.113]: errno=Connection timed out
npm ERR! github.com[1: 192.30.255.112]: errno=Connection timed out

以下是一些版本信息:

uname -a
Linux bde2744830c3 4.1.12-103.7.1.el7uek.x86_64
npm --version 
5.5.1

我已经搜索了SO和其他具有类似帖子的网站,但没有提供帮助。我试过了

npm cache verify 

无济于事。

这可能是由于存储库网址使用 git 协议 ( git:// ( 而不是 http。请确保您已打开入站端口 9418 才能正常工作。

希望有帮助。

相关内容

最新更新