npm WARN npm npm does not support Node.js on Ubuntu

Normally you have tried:

sudo apt remove nodejs 
sudo apt remove npm
sudo apt install nodejs
sudo apt install npm

It didn’t work. You have also tried:

npm install npm@latest -g

It prompted the error again. You have also tried:

curl https://www.npmjs.com/install.sh | sudo sh

It didn’t work.

Do this:

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

It will work.

Read more at this https://github.com/nodesource/distributions/blob/master/README.md#deb

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cing Sian Dal

Don’t follow me. I wrote junks here. Follow me on Twitter instead.