Reading package lists... Done
Building dependency tree       
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: nodejs-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
  • Try sudo apt install nodejs first and then try to install npm – Arun Jun 30 '17 at 6:30

The answer to your question of why is in the output of apt-get:

you have held broken packages

To fix broken package dependencies run it with the -f option:

sudo apt-get install -f [PACKAGE...]

You can run the command without any packages at all or you can specify one or more packages (e. g. npm) to install them at the same time.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.