0

In Ubuntu 12.04,I am trying to install less and handlers using npm.While installing npm I found this error

sudo apt-get install npm
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 (>= 0.4)
E: Unable to correct problems, you have held broken packages.

Please help me to resolve this issue. Thanks for the helping me.

Klaus D.
  • 799

1 Answers1

2

It looks like that version of npm isn't supported any more, updating node (and npm with it) resolved the issue.

First, uninstall the outdated version (optional, but I think this fixed an issue I was having with global modules not being pathed in).

sudo apt-get purge nodejs npm

Then install from Chris Lea's repo:

sudo apt-get update    
sudo apt-get install -y python-software-properties    
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update   
sudo apt-get install nodejs
muru
  • 197,895
  • 55
  • 485
  • 740
BDRSuite
  • 3,156
  • 1
  • 12
  • 11