我想在Amazon Linux 2上安装最新的NodeJS,但只能安装v6.17.1。
我看到nodesource/distributions,并尝试安装最新的NodeJS。当时的命令如下。
[root@ip-]# curl -sL https://rpm.nodesource.com/setup_13.x | bash -
## Installing the NodeSource Node.js 13.x repo...
## Inspecting system...
~~~
## Run `sudo yum install -y nodejs` to install Node.js 13.x and npm.
## You may also need development tools to build native addons:
sudo yum install gcc-c++ make
## To install the Yarn package manager,run:
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo yum install yarn
[root@ip-]# yum install -y nodejs
Loaded plugins: extras_suggestions,langpacks,priorities,update-motd
Repository nodesource is listed more than once in the configuration
Repository nodesource-source is listed more than once in the configuration
198 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 2:6.17.1-1nodesource will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================
Installing:
nodejs x86_64 2:6.17.1-1nodesource nodesource 13 M
Transaction Summary
============================================================================================================================================================================================================
Install 1 Package
Total download size: 13 M
Installed size: 39 M
Downloading packages:
nodejs-6.17.1-1nodesource.x86_64.rpm | 13 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:nodejs-6.17.1-1nodesource.x86_64 1/1
Verifying : 2:nodejs-6.17.1-1nodesource.x86_64 1/1
Installed:
nodejs.x86_64 2:6.17.1-1nodesource
Complete!
[root@ip-]# node --version
v6.17.1
这样,只能安装v6.17.1。
如何安装最新版本?