Can't install npm - Unable to correct problems, you have held broken packages?

I had the same issue with npm and had to install the following packages in order:

sudo apt install libssl1.0-dev
sudo apt install nodejs-dev
sudo apt install node-gyp
sudo apt install npm

Hope this helps


I had the same issue with npm.

I suggest you install aptitude which can help you resolve conflicts

sudo apt install aptitude

then install your package with aptitude

sudo aptitude install npm

sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/bin/node*
sudo rm -rf /usr/local/include/node*

sudo apt-get purge nodejs npm
sudo apt autoremove

Then install node and npm