【发布时间】:2019-01-15 09:43:02
【问题描述】:
当我尝试安装 web3.js 时出现此错误:
我的系统配置是:
Windows 7
节点:v6.11.0
npm: 3.10.10
npm i ethereum/web3.js --save
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url npm WARN addRemoteGit npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:204:12) npm WARN addRemoteGit at emitTwo (events.js:106:13) npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7) npm WARN addRemoteGit at maybeClose (internal/child_process.js:891:16) npm WARN addRemoteGit at Socket.<anonymous> (internal/child_process.js:342:11) npm WARN addRemoteGit at emitOne (events.js:96:13) npm WARN addRemoteGit at Socket.emit (events.js:188:7) npm WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:497:12) npm WARN addRemoteGit ethereum/web3.js resetting remote C:\Users\afeyzi\AppData\Roaming\npm-cache\_git-remotes\git-github-com-ethereum-web3-js-git-6339a8c5 because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url npm WARN addRemoteGit npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:204:12) npm WARN addRemoteGit at emitTwo (events.js:106:13) npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7) npm WARN addRemoteGit at maybeClose (internal/child_process.js:891:16) npm WARN addRemoteGit at Socket.<anonymous> (internal/child_process.js:342:11) npm WARN addRemoteGit at emitOne (events.js:96:13) npm WARN addRemoteGit at Socket.emit (events.js:188:7) npm WARN addRemoteGit at Pipe._handle.close [as
_onclose] (net.js:497:12) npm WARN addRemoteGit killed: false, npm WARN addRemoteGit code: 1, npm WARN addRemoteGit signal: null, npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
【问题讨论】:
-
你的 npm 版本太旧了。尝试升级。此外,如果您在 cygwin 中运行 npm,请尝试通过标准命令提示符运行它(cygwin 上的 npm 有时会出现问题)。