Ubuntu/Debian/CentOS 安装nodejs v8/v10/v11/v12/v13
作者: 分类:前端开发 浏览(31) 2019-11-4

Ubuntu/Debian安装说明

Node.js v13.x:

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_13.x | bash -
apt-get install -y nodejs

Node.js v12.x:

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs

Node.js v11.x:

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs

Node.js v10.x:

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs

Node.js v8.x:

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs

可选: 安装构建工具

要从npm编译和安装本地插件,您可能还需要安装构建工具:

# use `sudo` on Ubuntu or run this as root on debian
apt-get install -y build-essential

CentOS安装说明

以root身份在RHEL,CentOS,CloudLinux或Fedora上运行:

NodeJS 13.x

curl -sL https://rpm.nodesource.com/setup_13.x | bash -

NodeJS 12.x

curl -sL https://rpm.nodesource.com/setup_12.x | bash -

NodeJS 11.x

curl -sL https://rpm.nodesource.com/setup_11.x | bash -

NodeJS 10.x

curl -sL https://rpm.nodesource.com/setup_10.x | bash -

NodeJS 8.x

curl -sL https://rpm.nodesource.com/setup_8.x | bash -

然后运行:yum install -y nodejs

本文固定链接: http://www.codejie.net/6027.html