我正在尝试在 centos 7 的服务器上安装最新稳定版本的 nodejs。但是安装后,版本仍然与之前相同:
node -v
v6.17.1
sudo n stable
install : node-v10.16.0
mkdir : /usr/local/n/versions/node/10.16.0
fetch : https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.gz
######################################################################## 100.0%
installed : v6.17.1
我也尝试过这种方法:
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
sudo yum install nodejs
Loaded plugins: fastestmirror, langpacks
Repository nodesource is listed more than once in the configuration
Repository nodesource-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirror.awanti.com
* epel: ru.download.ispsystem.com
* extras: mirror.awanti.com
* ispsystem-5.200: ru.download.ispsystem.com
* ispsystem-base: ru.download.ispsystem.com
* updates: centos-mirror.rbc.ru
Package 2:nodejs-6.17.1-1nodesource.x86_64 already installed and latest version
Nothing to do
无论如何,版本仍然是 6.17.1。v6.17.1 与 v10.16.0 相同吗?如果不是,我该如何安装实际的最新稳定版本的 nodejs?