前言
详细安装文档请转到:https://github.com/nodesource/distributions
安装
- Ubuntu 安装 nodejs
# 安装 Node.js v12.x:
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
# 安装 Node.js v11.x:
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs
- CentOS 安装 nodejs
# 安装 Node.js v12.x:
curl -sL https://rpm.nodesource.com/setup_12.x | bash -
sudo yum install -y nodejs
# 安装 Node.js v11.x:
curl -sL https://rpm.nodesource.com/setup_11.x | bash -
sudo yum install -y nodejs
注意
- 根据上面的安装命令 curl -sL https://rpm.nodesource.com/
setup_11.x| bash -,安装不同的版本,区别在于setup_11.x版本号不同。 - 例如:Ubuntu 安装
Node.js v10.x
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

本文提供了一个详细的Node.js安装教程,涵盖了在Ubuntu和CentOS系统上安装Node.js v11.x和v12.x的步骤。通过使用curl命令下载并设置Nodesource仓库,然后利用apt-get或yum安装工具进行安装。
1103

被折叠的 条评论
为什么被折叠?



