-
Notifications
You must be signed in to change notification settings - Fork 3.1k
How to select the Node.js version to install
With our newly updated repository, users now have the flexibility to select a specific version of Node.js to install, empowering them to cater their development environments to their precise needs.
You must have the repo installed ->
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
, change the version18.x
as needed.
-
List Available Node.js Versions:
Before installing Node.js, you might want to see which versions are available in the repository.
# Display available versions of Node.js from the repository apt-cache policy nodejs
-
Choose and Install a Specific Node.js Version:
Once you've decided on a version, you can install it using the following command, replacing
<version>
with your chosen version:# Install a specific version of Node.js. Replace '<version>' with the desired version number apt-get install nodejs=<version>
Example:
If you wish to install version
18.16.0-1nodesource1
of Node.js:# Install Node.js version 18.16.0-1nodesource1 apt-get install nodejs=18.16.0-1nodesource1
You must have the repo installed ->
curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
, change the version20.x
as needed.
-
List Available Node.js Versions:
Before installing Node.js, you might want to see which versions are available in the repository.
yum Example:
yum --showduplicates --repoid=nodesource-nodejs list nodejs
dnf Example:
dnf repository-packages nodesource-nodejs list --showduplicates
-
Choose and Install a Specific Node.js Version: Once you've decided on a version, you can install it using the following command, replacing
<version>
with your chosen version:yum install nodejs-<version>-1nodesource -y
Example:
yum install nodejs-20.7.0-1nodesource -y
Thank you for choosing our repository for your Node.js needs. Should you require further guidance, do not hesitate to reach out.