Why only outdated version of NPM is available on Debian/Ubuntu?

Raj Bhatia picture Raj Bhatia · May 21, 2017 · Viewed 10.1k times · Source

I'm using a Debian/Ubuntu based distribution (specifically, AWS Ubuntu 16.04) and trying to install NPM through apt-get.

My Angular 2 application needs a higher version than 3.9.x of NPM, but the default version which is getting installed is 3.5.2 using sudo apt-get install npm on AWS Ubuntu 16.04. I'm trying to update NPM, but it's not getting upgraded to 4.6.1 (latest) from 3.5.2.

How do I install/update NPM so that I've got the latest version?

Answer

StefanBob picture StefanBob · Jan 30, 2019

type 'hash -r' on your server bash.

Then check your 'npm -v' again