You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: Cannot find module 'internal/fs' when npm install on mac #9377
hi @gibfahn . I used brew. I uninstalled node, wiped entirely the node_modules library (rm -rf /usr/local/lib/node_modules) and reinstalled by brew
Reacted by Clément Garbay, Greg Westneat, Kevin Brown, Li Jingyi, Vladimir Pudluzhnyy, Michał Mela, Rahul Dongare, Raul Rivero, Ethan Mallove, John and 3 more
If it's not working for you make sure that your version of npm is actually under /usr/local/lib/node_modules/npm. Run which npm. For node installed e.g. through ansible nodejs role it can be in: ~/nodejs/bin/npm. If that's the case then you want to rm -rf ~/nodejs/lib/node_modules/npm. Reinstall and you should be fine.
I get this error when I switched to older node with nvm.
Here my solution. I tried in console which bower it gives me /usr/bin/bower it was symlink to /usr/lib/node_modules/bower/bin/bower so I just removed symlink sudo rm /usr/bin/bower and removed module itself rm -rf /usr/lib/node_modules/bower and installed bower again npm i -g bower. After that was no error
For me this error came after using gulp serve command on angular1-gulp project, by removing the local node_modules folder and doing npm install solved this error.
node 7.9.0
npm 4.2.0
node installed using nvm version 0.25.1
Mac OS Sierra.
I also experienced it lately and solved it in the following way. For me there was a conflict but at the system level and it was caused by not cleaned properly, old nodejs installation. I couldn't use latest bower package, so after reading your comments
I ran into this issue as well when using lerna bootstrap. Turned out I had a node_modules folder in my home directory that had a copy of NPM in it that lerna was using. No idea how that got there, but removing it did the trick.
Activity
cjihrig commentedon Oct 31, 2016
Hm, can you read over the discussion in #9355.
Fishrock123 commentedon Oct 31, 2016
I'm getting a #3606 vibe from these. Smells like an installer problem.
Fishrock123 commentedon Oct 31, 2016
@shufanshijie
What is the output of
node -vandnpm -v?How did you install Node.js?
Fishrock123 commentedon Oct 31, 2016
If you run
rm -rf /usr/local/lib/node_modules/npmand then re-install Node.js does it work?thefourtheye commentedon Oct 31, 2016
Unable to reproduce the problem.
Could be because of the stale npm installation, but not sure how that could have happened though. Please try what @Fishrock123 suggested above.
giulio-sefaira commentedon Nov 1, 2016
Same problem for me on a MacOsX Sierra:
I tried to uninstall / reinstall, but it didn't fix the problem
gibfahn commentedon Nov 1, 2016
@shufanshijie @giulio-sefaira How did you install node? With
brewornvm? Or directly from https://nodejs.org/en/download/ ?giulio-sefaira commentedon Nov 1, 2016
hi @gibfahn . I used brew. I uninstalled node, wiped entirely the node_modules library (
rm -rf /usr/local/lib/node_modules) and reinstalled by brewOnceMore2020 commentedon Nov 1, 2016
I tried to reinstall
nodewithbrewand delete entire/usr/local/lib/node_modules, the error still happens.Fishrock123 commentedon Nov 1, 2016
@giulio-sefaira @OnceMore2020 could you please run
which npm?giulio-sefaira commentedon Nov 1, 2016
@Fishrock123
giulio-sefaira commentedon Nov 1, 2016
$ /usr/local/bin/npm -v 3.10.8Leolik commentedon Nov 1, 2016
get this error in Ubuntu 16.04
node -v = v7.0.0
npm -v = 3.10.8
gibfahn commentedon Nov 1, 2016
@Leolik How did you install node?
71 remaining items
haleyparty commentedon Jun 1, 2017
Also ran into this issue when on Node 8. Set my nvm to v6.10.3 fixed the issue.
TimothyGu commentedon Jun 1, 2017
@adamreisnz @haleyparty Could (one of) you create a new issue with full stack trace? Thanks!
haleyparty commentedon Jun 1, 2017
@TimothyGu Will do now!
TimothyGu commentedon Jun 1, 2017
For posterity: #13361
panpepson commentedon Jun 14, 2017
Hi,
ive removed all the node.js package on my OS
apt-get purge node.js
and manually remove/clear
/home/user*/(.npm,.ionic), /root/(.npm,.ionic), /usr/lib/node_modules
manual removal of the remainder helped and update your OS and new install node.js and ionic
cu
panpepson commentedon Jun 14, 2017
Hi,
ive removed all the node.js package on my OS
apt-get purge node.js
and manually remove/clear
/home/user*/(.npm,.ionic), /root/(.npm,.ionic), /usr/lib/node_modules
manual removal of the remainder helped and update your OS and new install node.js and ionic
cu
dtruffaut commentedon Jun 18, 2017
On Windows, I confirm that deleting the directory :
C:\Users<your_username>\AppData\Roaming\npm\node_modules
solves the issue.
jspblm commentedon Jul 9, 2017
@Fishrock123 Solution works for me on node v8.1.3 and npm 5.0.3
MichalZalecki commentedon Jul 11, 2017
@Fishrock123 solution is generally working 💥
If it's not working for you make sure that your version of npm is actually under
/usr/local/lib/node_modules/npm. Runwhich npm. For node installed e.g. through ansible nodejs role it can be in:~/nodejs/bin/npm. If that's the case then you want torm -rf ~/nodejs/lib/node_modules/npm. Reinstall and you should be fine.redexp commentedon Jul 22, 2017
I get this error when I switched to older node with nvm.
Here my solution. I tried in console
which bowerit gives me/usr/bin/bowerit was symlink to/usr/lib/node_modules/bower/bin/bowerso I just removed symlinksudo rm /usr/bin/bowerand removed module itselfrm -rf /usr/lib/node_modules/bowerand installed bower againnpm i -g bower. After that was no errorshahzadns commentedon Aug 17, 2017
For me this error came after using
gulp servecommand on angular1-gulp project, by removing the localnode_modulesfolder and doingnpm installsolved this error.node
7.9.0npm
4.2.0node installed using nvm version
0.25.1Mac OS Sierra.
Hope this will help someone.
Cheers !
develucas commentedon Aug 30, 2017
I also experienced it lately and solved it in the following way. For me there was a conflict but at the system level and it was caused by not cleaned properly, old nodejs installation. I couldn't use latest bower package, so after reading your comments
I've deleted the second directory as it was for nodejs 6.x, and all returned to normal.
Cheers
taylorc93 commentedon Sep 18, 2017
I ran into this issue as well when using
lerna bootstrap. Turned out I had anode_modulesfolder in my home directory that had a copy of NPM in it that lerna was using. No idea how that got there, but removing it did the trick.zhuziyi1989 commentedon Mar 28, 2018
Reference solution: #9355