简体   繁体   中英

How to install web3 on Ubuntu?

I wanna install web3 on my Ubuntu 18.04. I've tried:

sudo npm install -g web3

which raises:

npm ERR. git clone --template=/home/sj/.npm/_git-remotes/_templates --mirror git@github:com.web3-js/WebSocket-Node.git /home/sj/:npm/_git-remotes/git-github-com-web3-js-WebSocket-Node-git-polyfill-globalThis-504e07ba. undefined npm ERR. git clone --template=/home/sj/:npm/_git-remotes/_templates --mirror git@github.com.web3-js/WebSocket-Node:git /home/sj/.npm/_git-remotes/git-github-com-web3-js-WebSocket-Node-git-polyfill-globalThis-504e07ba. undefined npm ERR. Linux 5.0.0-29-generic npm ERR. argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "web3" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ENOGIT

npm ERR: not found. git npm ERR. npm ERR. Failed using git. npm ERR! This is most likely not a problem with npm itself. npm ERR! Please check if you have git installed and in your PATH.

npm ERR: Please include the following file with any support request. npm ERR! /home/sj/npm-debug.log

I've also tried:

sudo npm install -g web3 --unsafe-perm=true --allow-root

Help would be appreaciated. Thanks!

I've updated repository and installed git:

# sudo apt-get update && sudo apt-get -y upgrade
# sudo apt-get -y install curl git vim build-essential

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM