咨询了chatgpt,得到这个答案。经测试,有效。
You:
how to install designated version nodejs? on centos
AI:
To install a specific version of Node.js on CentOS, you can follow these steps:
-
First, update the package manager by running the following command:
sudo yum update
-
Install the
curl
package by running the following command:sudo yum install curl
-
Download the Node.js installation script for the desired version by running the following command:
curl -sL https://rpm.nodesource.com/setup_<version>.x | sudo bash -
Replace
<version>
with the version number of Node.js that you want to install. For example, to install Node.js version 14.x, you would run:curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
-
Install Node.js by running the followi