如何在 Ubuntu 16.04 中全局安装 web3?

问题描述 投票:0回答:1

我正在尝试通过 npm 安装 web3。

sudo npm install -g web3
但是我遇到了以下错误。

tom@ubuntu:/$ sudo npm install -g web3
npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise 
Support
npm WARN deprecated [email protected]: ⚠️  WARNING ⚠️ tar.gz module has been 
deprecated and your application is vulnerable. Please use tar module instead: 
https://npmjs.com/tar
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b browserifyCompatible 
git://github.com/frozeman/WebSocket-Node.git 
/home/tom/.npm/_cacache/tmp/git-
clone-d38db07b
npm ERR! /home/tom/.npm/_cacache/tmp/git-clone-d38db07b/.git: Permission denied
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tom/.npm/_logs/2018-02-07T14_42_37_459Z-debug.log

如何安装 web3?

npm ubuntu-16.04 web3js
1个回答
1
投票

看起来你的本地

.npm
权限搞砸了。只需通过运行删除 NPM 缓存:

sudo rm -rf /home/tom/.npm

然后再试一次。

© www.soinside.com 2019 - 2024. All rights reserved.