简体   繁体   中英

module.js:471 throw err;

I have been trying to solve this one the whole day and am at my wits end.

npm doesn't work and throws the following error whenever I try anything with it:


C:\Users\Bernh\Desktop\Coding Projects> npm -v
module.js:471
    throw err;
    ^

Error: Cannot find module 'inherits'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Bernh\AppData\Roaming\npm\node_modules\npm\node_modules\readable-stream\lib\_stream_readable.js:68:17)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

I have tried: -reinstalling nodejs -installing different versions of nodejs -running any npm command give the same error

I have been refereed to a few similar answers on stackoverflow, but these aren't the same as everyone uses npm to fix their npm... by npm does nothing.

Also some of the answers are for lunix command lines and I can't find any equivalent commands for windows.

I have tried an installer call choco, but doesn't seem to be able to work with the npm install/uninstall

Any solutions or suggestions?

Regards

After two days of work I found the problem.

I manually went into the Program Files and Program Files (x86) folders and deleted everything to do with npm and nodejs.

I then deleted XAMPP which I had installed near the time the problems occurred.

I then did a neat restart and reinstalled nodejs 6.11.4 LTS.

This seemed to have fixed the problem.

Hope this helps someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM