-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Yarn, PNPM, others (was: Cannot find module './build/Release/re2') #92
Comments
I never used Is it 100% reproducible or happens randomly? Did you try it in some other configurations, e.g., making |
Including it directly WFM:
|
Including it indirectly (adding
PS: I do see this line:
But I don't see any link for it. |
The versions:
|
I inspected the created |
That sounds like my bug. I'll do a fix and test it, thx. |
fyi I am also having the same error with using node |
fyi I came across this error when upgrading from node downgrading back to node |
FWIW, I get the same problem with yarn. On Mac, deleting node_modules and reinstalling usually fixes the problem, but it does not work on Windows. Node versions are also v14.x. |
I also noticed the same issue with node 10.x occasionally. It seems the proper workaround is to delete the node_modules folder. I would bet that the bug is in RE2's "download binary or rebuild" workflow. |
What bothers me is that according to reports from you guys the problem is intermittent. It is not like "RE2's 'download binary or rebuild' workflow" runs a generator of random numbers. It must be something related to race conditions when yarn/pnpm running initialization for multiple packages in parallel. One obvious problem on my side is calling I'll try to detect what package manager is used and call appropriately or just bypass a download completely. |
Actually it is not a bug: a script called |
The issue appears to occur when a module rebuild occurs. It seems that yarn will delete built modules more aggressively than npm when some other module in the dependency tree changes, and it tries to rebuild all native-compiled modules when that occurs. When that happens, it seems like re2 doesn't rebuild itself and assumes it's built binary still exists. So not "intermittent" but just under specific situations. |
Do we have a minimal repro case? |
i will try making one this weekend. feel free to ping me monday I don't post by then. |
@jasonswearingen ping! |
thanks, I will get this going in the morning! |
hello, repro here: https://github.com/jasonswearingen/20210416-re2-bug-repro/tree/main/bugrepro using node 14.x and yarn 1.x |
Status update: I spent some time analyzing the problem. It seems that I have to detect what package manager is used and invoke it to rebuild the package. Right now: if for some reason a prebuilt binary release has failed to be properly installed for whatever reasons, then Potential problem: the new version of |
Having this same issue with node 10.x and yarn 1.22.x on Windows. The issue for us is that it's failing to find prebuilt binaries due to looking for a modules version of "64" where the earliest available on GitHub for release 1.16.0 is "72". So, referring to this I guess we need Node v12 or newer to use those binaries. Update: After exploring the other option of getting node-gyp plus it's dependencies installed and working I've identified that yarn isn't running the post install script to do the download and compile at all. I think this is because it's called I raised a PR to change the install script name and to downgrade the node-gyp dependency to v7 (which supports both Python 2 and 3 and works better on Windows). This is working reliably for me using yarn on Windows with Node v10. You have to manually install some other dependencies for node-gyp to work and on Windows I just installed the |
On Node 10: it is EOLed already. See the wiki for more details. Node 15 will be EOLed in a few weeks. It should still work for those and other versions, but no precompiled binaries. It will compile locally. Generally, the idea of precompiled binaries is not about avoiding setting up the necessary node-gyp environment, but to save users of common configurations some time and CPU ticks, if possible. I am looking forward to review and test the PR when I am back in a week. Thank you very much! |
Sure, that is a valid point and we need to upgrade. I think the challenge for us is that |
I see this all the time on Node v14.16.1. Rming node_modules and reinstalling all my packages seems to work. On a m1 air. |
I have removed the node_moduels and reinstalled them but the issue still exists |
I have this issue when running our CI/CD pipelines in Alpine, node 12. Our dev machines, which are Macbooks, have no problem until codes are pushed up there. |
This went from intermittent to now happening all the time for me. Lost already an entire day on this. Is this library absolutely necessary to have at all? The cumulative time for this issue across our project life is beyond belief. |
@mschipperheyn If you are using
|
Note: corepack could be of help communicating with different package managers. At the moment it is an experimental feature of Node. |
I'm also seeing this when using esbuild. Here's an example repo demonstrating the issue: |
@dmcd I tried the demo repo you created (thanks!) and I can reproduce what you see. Specifically, I see this error:
Yet, when I inspect the directory referenced above it is there:
The file that refers to it is there too:
Must be something wrong with a module loader used by |
I opened a PR: yarnpkg/berry#4546 |
The PR was merged. I understand that there is still an issue with PNPM. If it is still important/critical, please open another PNPM-specific ticket. |
I am also getting it for esbuild.
|
I'm running into the same issue with esbuild and I'm wondering whether it's due to
Inspecting the "Release" folder shows an
Which is then going to use the copy loader for any native node files, and automatically copy them next to your bundles & correctly reference them in your compiled JS. Seeing as the re2 "require" above doesn't have the @uhop can we change the import to explicitly state Thank you! |
Thank you for the suggestion. I'll test it and if it doesn't affect other environments I'll update the import. |
Meet the same problem. |
env: |
Getting same issues with pnpm and node v18.19.0
|
Hi! So I noticed you have some unusual errors with yarn, but I just encountered this same problem with the
pnpm
package manager. To me it seems that the package manager is not running theinstall
script for some reason. I've pinged their discord channel to see if they can help on their end.In my case I'm trying to install get-urls, which depends on url-refex-safe, which ultimately depends on
node-re2
.The text was updated successfully, but these errors were encountered: