skip to Main Content

I am a newbie with Linux general, and here’s what I am trying to achieve:

I am trying to install nodejs version on Debian Linux with the following command:

apt-get install nodejs=8.14.0

But I get this error in return:

E: Version '8.14.0' for 'nodejs' was not found

As far as I found, this is the correct way to specify a version. If I do this, then it works fine:

apt-get install nodejs

But I need this specific version, and not the latest one. I am doing this for a Docker image, so it has to be installed at runtime.

3

Answers


  1. You can try installing your node using a package manager like nvm:

    Installing Node.js to linux

    Or download the binaries directly from here:
    Node.js v8.14.0

    Login or Signup to reply.
  2. Make sure you have the following packages:-

    sudo apt-get install 
        apt-transport-https 
        curl 
        software-properties-common
    

    Enable the NodeSource repository by using a command:-

    sudo curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
    

    After enabling the repository, install Node.js using a command:-

    sudo apt-get install nodejs
    
    Login or Signup to reply.
  3. If you’re doing this for a Docker image, why not just use the Node Docker image with the version you need?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search