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
RHEL
/ CentOS
/ CloudLinux
/ Fedora
系统使用root
账户
$ curl -sL https://rpm.nodesource.com/setup_10.x | bash -
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
RHEL
/ CentOS
/ CloudLinux
/ Fedora
系统使用root
账户
$ curl -sL https://rpm.nodesource.com/setup_8.x | bash -
Node.js v6.x
Ubuntu
及类似系统:
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs
Debian
使用root
账户
$ curl -sL https://deb.nodesource.com/setup_6.x | bash -
$ apt-get install -y nodejs
RHEL
/ CentOS
/ CloudLinux
/ Fedora
系统使用root
账户
$ curl -sL https://rpm.nodesource.com/setup_6.x | bash -
可选:安装 build tools
To compile and install native addons from npm you may also need to install build tools:
Ubuntu
下请使用sudo
命令,Debian
下请使用root
账户:
$ apt-get install -y build-essential
RHEL
/ CentOS
/ CloudLinux
/ Fedora
系统使用root
账户
$ yum install gcc-c++ make
# 或使用以下命令
$ yum groupinstall 'Development Tools'
参考NodeSource
在github
上的node.js
发布页: