【问题标题】:Cannot install web3 node module无法安装 web3 节点模块
【发布时间】:2019-01-08 20:40:34
【问题描述】:

根据文档,npm install web3 将安装该库,但是当我尝试安装该模块时,它会引发以下错误:

PS F:\Sportist> npm install web3
npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
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 ERR! Error while executing:
npm ERR! C:\Users\aayush.thakur\AppData\Local\Programs\Git\cmd\git.EXE ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git
npm ERR!
npm ERR! fatal: read error: Invalid argument
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\aayush.thakur\AppData\Roaming\npm-cache\_logs\2018-08-01T07_46_08_899Z-debug.log

完整日志:link

【问题讨论】:

  • 在cmd而不是powershell上试试
  • 在 cmd 上遇到同样的错误。
  • 你是否完全卸载了node和npm并重新安装了?
  • 您能否确保您已将 Git 安装在正确的位置并分享错误日志?
  • 通过环境变量安装并导出Git,添加错误日志。

标签: ethereum web3


【解决方案1】:

尝试通过执行命令添加git config:git config --global url."https://".insteadOf git://

这个 git 配置会将 git://github.com/frozeman/WebSocket-Node.git 更改为 https://github.com/frozeman/WebSocket-Node.git

【讨论】:

  • 这解决了我在 Windows 7 上使用 npm 的问题。谢谢 matt9
猜你喜欢
  • 1970-01-01
  • 2021-12-03
  • 2022-01-08
  • 2021-11-16
  • 2021-06-07
  • 2020-10-02
  • 2013-07-27
  • 1970-01-01
相关资源
最近更新 更多