Issue
I am trying to install NPM. To do so, I ran:
sudo apt-get install nodejs
This worked successfully. I then ran:
sudo apt-get install npm
Reading state information... Done
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Trying to install node-gyp leads down an endless path of "unmet dependencies".
I followed these instructions and have 0 not upgraded packages; https://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies-after-adding-a-ppa
I disabled all Other Software Source and still have problems. I keep running into this issue for other packages (hhvm and mono). What can I do to resolve these issues?
Solution
I exactly had the same symptom and error message when installing npm.
Refer to Node Package Manager got corrupted
You can do the following
sudo apt-get remove nodejs npm ## remove existing nodejs and npm packages
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
This works on my Ubuntu 16.04.2
Answered By - j3ffyang Answer Checked By - David Goodson (WPSolving Volunteer)