安装说明
Node.js v12.x:
#使用Ubuntu
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
#使用Debian,root
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
Node.js v11.x:
#使用Ubuntu
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs
#使用Debian,作为root
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs
Node.js v10.x:
#使用Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
#使用Debian,root
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
Node.js v8.x:
#使用Ubuntu
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
#使用Debian,作为root
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs
可选:安装构建工具
要从npm编译和安装本机插件,您可能还需要安装构建工具:
#在Ubuntu上使用`sudo`或在debian
apt-get install -y build-essential上以root身份运行它