128

sudo npm install -g truffle 安装 truffle 的时候无法下载 bignumber.js

zhouxinxin · 于 发布 · 最后由 flossie回复 · 986 次阅读

我在使用sudo npm install -g truffle 命令安装truffle的时候遇到下面的错误,重试多次无效, 有什么解决办法吗?

npm ERR! git clone --template=/home/peter/.npm/git-remotes/templates --mirror https://github.com/debris/bignumber.js.git /home/pemaster-df3f1ce1: Cloning into bare repository '/home/peter/.npm/_git-remotes/git-https-github-com-debris-bignumber-js-git-master-df
npm ERR! git clone --template=/home/peter/.npm/_git-remotes/_templates --mirror https://github.com/debris/bignumber.js.git /home/pemaster-df3f1ce1: error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
npm ERR! git clone --template=/home/peter/.npm/
git-remotes/_templates --mirror https://github.com/debris/bignumber.js.git /home/pemaster-df3f1ce1: fatal: The remote end hung up unexpectedly
npm ERR! git clone --template=/home/peter/.npm/
git-remotes/_templates --mirror https://github.com/debris/bignumber.js.git /home/pemaster-df3f1ce1: fatal: early EOF
npm ERR! git clone --template=/home/peter/.npm/_git-remotes/_templates --mirror https://github.com/debris/bignumber.js.git /home/pemaster-df3f1ce1: fatal: index-pack failed
npm WARN optional Skipping failed optional dependency /truffle/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.15
npm ERR! Linux 4.4.0-57-generic
npm ERR! argv "/usr/local/nodejs/bin/node" "/usr/local/bin/npm" "install" "-g" "truffle"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code 128

  • 51 large
    rubyu2

    这个依赖你自己从git上载下来,拷贝到全局的node_modules目录里试试。天朝的网络,经常会有问题的。

  • 128
    flossie

    我也遇到了同样的问题,请问你解决了吗?