Update NPM and NODE on Ubuntu

update npm:

sudo npm install npm -g

if failing:

sudo npm update npm -g

Update NODE,

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node 

make sure to replace

<VERSION>

with the version you just installed in the last command.

Add your comment