Error: Cannot find module 'npm-registry-client'

Had same problem. I'm using Ubuntu. Steps that I've done:

  1. deleted folder /usr/lib/node_modules
  2. reinstalled nodejs using this help nodejs
  3. updated npm to latest stable using sudo npm update -g npm

Basicly you have to reinstall nodejs :( Nothing else helped. P.S. just in case: save somewhere list of packages which you need, just listing node_modules folder(ls -l /usr/lib/node_modules) and saving output. So you can reinstall them later.


It seems to be a bug in [email protected]. you should try upgrading from [email protected] directly to npm@next, which will bypass the buggy versions of npm. If you're currently stuck with a broken npm, and you can get back to a working npm by reinstalling Node.js.

The best way to jump over this problem is to reinstall Node using an official Node installer (not Homebrew) and use the packaged npm to upgrade straight to npm@next.

To reinstall Node.js:

rm -rf /usr/local/lib/node_modules

Using Ubuntu

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -

sudo apt-get install -y nodejs

Using Debian, as root

curl -sL https://deb.nodesource.com/setup_5.x | bash -
apt-get install -y nodejs

I had the same problem on Windows and found that the node uninstaller left the cache in place in AppData/Roaming.

This worked for me:

  1. Uninstall Node
  2. Remove npm and cache by hand
  3. Reinstall from the msi on the official Nodejs website

I believe npm-registry-client is a separate package.

Have you tried npm install npm-registry-client --save ?

https://www.npmjs.com/package/npm-registry-client

edit: It looks like your npm is just plain broke.

Maybe these steps will help:

rm -rf ./node_modules
npm install

Tags:

Node.Js

Npm