ubuntu里nodejs+npm+web3+solc环境搭建

nodejs+npm+web3+solc部署脚本 更新下软件源这样下面的脚本命令会快很多,如果之前添加过就算了.
(可选)

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

保存为sources.list
然后在当前目录下运行下面这两个命令来更新软件源 注意:只适用于乌班图16.04版本的
sudo cp /etc/apt/sources.list /etc/apt/sources.list.baksudo cp ./sources.list /etc/apt/sources.listsudo apt update

环境部署脚本
#! /bin/bashecho 更新软件列表 sudo apt updateecho 清理残余npm及nodejs sudo rm /usr/bin/npm sudo rm /usr/bin/node sudo rm /usr/bin/nodejs sudo rm/usr/local/lib/node sudo rm -r /usr/local/lib/node_modules sudo rm/usr/local/include/node sudo rm -r /usr/local/include/node_modules sudo rm/usr/local/bin/node sudo rm/usr/local/bin/npm sudo rm/bin/npm sudo rm/bin/node sudo apt remove nodejs -y sudo apt remove node -y sudo apt remove npm -y sudo apt remove nodejs-legacy -yecho 开始安装sudo apt install nodejs -y sudo apt install npm -y sudo apt install nodejs-legacy -yecho 安装react sudo npm install create-react-app-gecho 安装solc模块4.25版本sudo npm install --savesolc@0.4.25echo 安装web3sudo npm i web3@1.0.0-beta.36 --save

保存为xxx.sh然后
sudo xxx.sh
【ubuntu里nodejs+npm+web3+solc环境搭建】一键搞定
运行命令的时候必须在安装web3和solc的目录下
再给大家举个安装的例子,
https://www.cnblogs.com/8765h/p/4777746.html
千万不要用这个网站的第一个和第二个方法,因为用了后之后安装其他插件会报错。

    推荐阅读