-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module 'internal/fs' when npm install on Node 8 using mac #13361
Comments
npm 5 has some issues, does it work with npm 4.2 or any 4.x version?. |
This looks like a bad case of dependency management, as it seems like the code that's erroring out comes from graceful-fs v3, which is known to not work with recent Node.js versions. On the other hand, the latest version of npm (5.0.0, the one bundled with Node.js 8.0.0) does not depend on graceful-fs v3 in any way. Looking at the path of the problematic file Can you show the output of
? |
@haleyparty I had the same problem, but solved it by reinstalling node using That gave me a problem with
|
anyone able to solve this? i am having the same issue with node v5 and npm v4 |
anyone able to solve this? having same issue with node v5 and npm v4 |
I'm having issues and I'm using nvm to manage my node install. Seems that whenever I install whatever version (6, 7, 8) I still get the same issue. |
I have same problem, but with other packages(boom, request, tough-cookie etc.) and each time with random package. But it always throws error |
Assuming your rm -fr node_modules/ then npm install there were probably some binaries that needed recompiling with |
@lmj0011 yes, look like it fixes my problem. Thank you. Anyway I think it is not a better solution. I as npm user should not care about removing |
FWIW I encountered the same problem this morning on my Mac (Sierra, 10.12.4). Then installed nvm and used it to install the latest version node 8.1.0, npm 5.0.3. It worked. |
When you choose to upgrade node versions, I believe you should |
same problem that I have.
macOS Sierra version 10.12.3 |
I am having the same issue. I completely uninstalled node and npm and reinstalled them using homebrew. I also tried the suggestion above - removing node_modules and re-running npm install That gave me a bunch of "SKIPPING OPTIONAL DEPENDENCY" messages, and finally dying with:
Just for grins I wanted to see what happened when trying to run npm. When I try running again I get the same error. "Error: Cannot find module 'internal/fs'" Also running: MacOS Sierra 10.12.5 |
i reverted back to node v6.11.0 and npm v3.10.10 to make this work for me |
node 7,node 8 has this problem same as @ianoroceo |
Thanks everyone for your help. |
@RioBrewster I find these steps helpful - https://gist.github.com/TonyMtz/d75101d9bdf764c890ef and after uninstalling, I just download the node js installer at the site - https://nodejs.org/en/ |
Thanks – but I don’t have admin so I can’t do sudo.
From: ianoroceo <notifications@github.com>
Reply-To: nodejs/node <reply@reply.github.com>
Date: Friday, June 16, 2017 at 10:47 AM
To: nodejs/node <node@noreply.github.com>
Cc: Julie Lewis <Julie.Lewis@cpa.texas.gov>, Mention <mention@noreply.github.com>
Subject: Re: [nodejs/node] Cannot find module 'internal/fs' when npm install on Node 8 using mac (#13361)
CAUTION: This email originated from outside of the Texas Comptroller's email system.
DO NOT click links or open attachments unless you expect them from the sender and know the content is safe.
@RioBrewster<https://github.com/riobrewster> I find these steps helpful - https://gist.github.com/TonyMtz/d75101d9bdf764c890ef
it's the same steps I followed to uninstall node and npm on my mac
and after uninstalling, I just download the node js installer at the site - https://nodejs.org/en/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#13361 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AB3EJYDGSMf_JaoF-tZ7BWoINr-iKdwVks5sEqN1gaJpZM4Nshv2>.
|
@RioBrewster what does |
/usr/local/opt/node@6/bin/node
From: Gibson Fahnestock <notifications@github.com>
Reply-To: nodejs/node <reply@reply.github.com>
Date: Saturday, June 17, 2017 at 6:31 PM
To: nodejs/node <node@noreply.github.com>
Cc: Julie Lewis <Julie.Lewis@cpa.texas.gov>, Mention <mention@noreply.github.com>
Subject: Re: [nodejs/node] Cannot find module 'internal/fs' when npm install on Node 8 using mac (#13361)
CAUTION: This email originated from outside of the Texas Comptroller's email system.
DO NOT click links or open attachments unless you expect them from the sender and know the content is safe.
@RioBrewster<https://github.com/riobrewster> what does which node print?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#13361 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AB3EJYdI0jCLYyJke8u1etSpG9AVCz3Aks5sFGG_gaJpZM4Nshv2>.
|
switching to v6.11.0 solved the problem for me. Thanks @ianoroceo |
As I've pointed out in #13361 (comment), it is necessary to separate global packages installed for a specific Node.js version. Many of the issues described here are caused by assuming (intentionally or unintentionally) packages (like npm and its dependencies) installed for an older version of Node.js will work for a newer Node.js. In other words, this is not a bug in Node.js, but rather in your setup. To fix this, delete This thread has grown very long, and unrelated issues are starting to creep in. I will close this issue now, though we will be just as happy to help you figure this out at nodejs/help or IRC. |
Could be conflicts in node_modules folder. Good idea to make sure it's clean. Try: |
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 |
isn't whereis to locate a program? if I run So should I still delete the latter? Running Node v7.9.0 |
@justijndepover whereis also searches for sources, so I think directories are also a part of sources. Please be aware that how you've installed your nodejs is important rather than existence of particular directories. Basing on your comment only is hard to imagine what your problem really is. As I see here, the genesis of this broken behavior might be different for different cases. What is your case ? |
I had node installed via the MacOS installer. I followed this guide to uninstall Node. Then I reinstalled everything with Homebrew. Now everything works again. |
Reverting to node v6.9.5 fixed it for me too. |
Was getting this error consistently when trying to install packages using Node v8.0.0. Using nvm with v6.10.3 solved the issue. Stack trace:
The text was updated successfully, but these errors were encountered: