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
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
Make sure you have the following packages:-
Enable the NodeSource repository by using a command:-
After enabling the repository, install Node.js using a command:-
If you’re doing this for a Docker image, why not just use the Node Docker image with the version you need?