Error "Cannot find module 'npmlog'" after "npm update -g"

What fixed this for me was

sudo rm -rf /usr/local/lib/node_modules/

and then re-installing node (with npm).


It looks like npm update -g cannot update npm to the newest version. I solve the problem by updating npm installation manually.

  1. Install/ reinstall node to get the bundled npm
  2. run npm install -g [email protected] to update the global npm installation
  3. now npm update -g should work

Thanks for the answers. It was a bug and it has already been fixed in Node v5.4.1. Now it's working as usual.


I have faced the same issue in my Windows 10 PC. After looking into solutions, since i couldn't find the exact solution for the issue i was facing Cannot find module 'npmlog' I just uninstalled the node js and then, deleted both 'npm' and 'npm-cache' in "C:\Users\YourPCName\AppData\Roaming"

Then, i downloaded the latest version of node from Node JS Website

And, installed node js

After that i checked with the path in environment variables.

Finally run the command prompt 'run as administrator' and npm install npm -g

Checking your version will show the latest version. 'npm -v'

I got the latest version - v3.10.9

Try this. this should work.

Tags:

Node.Js

Npm

Nvm