Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Ubuntu have old versions of nodejs and npm in their apt-get package manager?

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?

like image 513
user1283776 Avatar asked Jan 07 '16 11:01

user1283776


People also ask

How do I install the latest version of npm in Ubuntu?

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!

Is npm installed by default on Ubuntu?

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.


1 Answers

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

UPDATE:

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).

like image 114
onel0p3z Avatar answered Oct 05 '22 23:10

onel0p3z