Skip to content

How to select the Node.js version to install

Jesus Paz edited this page Jan 12, 2024 · 8 revisions

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.


Instructions for Debian Systems:

You must have the repo installed -> curl -fsSL https://deb.nodesource.com/setup_18.x | bash -, change the version 18.x as needed.

  1. 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
  2. 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

Instructions for RPM Systems:

You must have the repo installed -> curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -, change the version 20.x as needed.

  1. 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
  2. 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.