When I install nodejs and npm with apt-get
sudo apt-get update
sudo apt-get install nodejs modejs-legacy npm
I have the versions
I get the following versions
npm -v
1.3.10
nodejs -v
v0.10.25
I know how to update these manually, but why does the apt-get package manager have old versions of these packages?
npm install -g npm@latest . If you run into any issues with npm being unable to update because it's not installed, you can install npm first by using sudo apt-get install -y npm , then run the command above to update it. sudo apt install build-essential . And that's it!
js and npm packages are available from the default Ubuntu 18.04 repositories. At the time of writing, the version included in the Ubuntu repositories is v8. 10.0 which is the previous TLS version.
It's better to use the ppa from nodesource. They have done a great job keeping it updated and offering not only LTS but also latest versions of node available. https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
As easy as running this from your cli:
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
The reason WHY the package manager has old versions of the binaries is due to the fact it takes time for the maintainers of the provided packages to properly build and test new ones with updated versions.
The good thing is that you can consume and install packages from other repositories (ppa).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With