Saturday, July 27, 2013

npm update error in Linux


Error

If you get the following error while updating npm:

error: unpacking of archive failed on file /usr/lib/node_modules/npm/doc: cpio: rename
or
Error: Cannot find module '../lib/npm.js'

Solution

Simply try to remove npm with your package manager, if that's how you installed it, or manually remove it. Then remove the following:

/usrlib/node_modules/npm
and
/usr/bin/npm

That should fix the broken packages, and you can try to reinstall npm!

Hope that helps!

2 comments: