Ubuntu – npm breaks after updating nodejs to 0.10

nodejsnpm

I am on 12.04LTS. I updated my system today and in that process nodejs got updated. Now my npm has stopped working. For e.g:

$ npm install express                     
npm http GET https://registry.npmjs.org/express
npm http 200 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express/-/express-3.1.0.tgz
npm http 200 https://registry.npmjs.org/express/-/express-3.1.0.tgz
npm ERR! cb() never called!
npm ERR! not ok code 0

Is anyone facing the same issue and knows a fix for this ?

Best Answer

Are you using Chris Lea's PPA? This might be helpful: https://chrislea.com/2013/03/15/upgrading-from-node-js-0-8-x-to-0-10-0-from-my-ppa/

Also to note is that the nodejs-dev and npm packages don’t exist anymore. The new nodejs package contains everything that these separate packages used to, because npm needs all the development files, and you’re not really using node these days if you’re not using npm. So we figured we’d just simplify things with the single package.

The upgrade will uninstall the previous versions, but apt can be a bit obstinate about doing this. Instead of the usual

sudo apt-get update
sudo apt-get upgrade

you will probably instead want to do something like

sudo apt-get update
sudo apt-get -y dist-upgrade
Related Question