Running "npm" returns "Error: cannot find inherited modules"

module.js:340 throw err; ^ Error: Cannot find module 'inherits' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/usr/lib/node_modules/npmconf/npmconf.js:3:16) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) 
+7
npm redhat yum
source share
9 answers

After exhausting other features (reinstalling npm and various other nodejs packages), I finally tried a simple one. :-)

 sudo yum install nodejs-inherits* 

It worked for me.

0
source share

The following worked for me. Another answer: sudo yum install nodejs-inherits *, did not help. Please note: before performing the following steps, you may need to create a backup copy of the / usr / lib / node_modules folder so that you can return to it to remember what you installed all over the world.

 sudo yum erase nodejs npm sudo rm -rf /usr/lib/node_modules sudo yum install nodejs npm 

Hope this helps someone.

+8
source share

I just uninstalled and reinstalled npm:

 brew uninstall npm brew install npm 

This was not without problems, I also had to return ownership of some libraries:

 sudo chown -R nice /usr/local/lib/node_modules/ 

and then

 brew postinstall npm 
+6
source share

sudo yum install nodejs-inherits * does not work for me. Also, I did not want to erase node_modules.

Erasing inherited modules and installing / reinstalling only new work:

 sudo yum erase nodejs-inherits sudo yum erase nodejs-inherits1 sudo yum install nodejs-inherits 
+2
source share

To share my information, I ran into this problem and solved it by installing inherits as follows:

 sudo npm install inherits 

This is a github repo .

+2
source share

I had this problem on Windows recently, the npm update has been fixed for me.

 npm update npm -g 
0
source share

This happens when I switch my node to version 5.5.0 to 'n'.

then I will go back to node 0.10.22, which I used before, and run

 npm update npm -g 

then it's ok now

0
source share

I encountered the same error on a 32-bit Windows 7 system and fixed it by deleting the nodes themselves. After a new installation of nodejs, I ran the following commands

 npm install -g npm-windows-upgrade npm-windows-upgrade -p -v latest 

This fixed the problem for me

0
source share

Running npm install –y helps me in my situation.
I do not know what the -y option means.

-3
source share

All Articles