Nodejs error: Cannot find module ‘npmlog’


I have a problem with Nodejs when i upgrade to v4.2.3 for Windows 7 64bits

D:\AppServ\www\chat>npm
module.js:339
    throw err;
    ^

Error: Cannot find module 'npmlog'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.j
s:18:11
    at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modul
es\npm\bin\npm-cli.js:75:3)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)

nodejs error npmlog

How to fix it. Follow to these steps

Step 1: Delete the folder: C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm

Step 2: Goto the folder: C:\Users\Administrator\AppData\Roaming\npm

If you see npm and npm.cmd, delete them

Done, now you can use npm

D:\AppServ\www\chat>npm

Usage: npm <command>

where <command> is one of:
    access, add-user, adduser, apihelp, author, bin, bugs, c,
    cache, completion, config, ddp, dedupe, deprecate, dist-tag,
    dist-tags, docs, edit, explore, faq, find, find-dupes, get,
    help, help-search, home, i, info, init, install, issues, la,
    link, list, ll, ln, login, logout, ls, outdated, owner,
    pack, ping, prefix, prune, publish, r, rb, rebuild, remove,
    repo, restart, rm, root, run-script, s, se, search, set,
    show, shrinkwrap, star, stars, start, stop, t, tag, team,
    test, tst, un, uninstall, unlink, unpublish, unstar, up,
    update, upgrade, v, verison, version, view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm faq          commonly asked questions
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    C:\Users\Administrator\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@2.14.7 C:\Program Files\nodejs\node_modules\npm

Leave a Reply