-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/isaacscript/isaacscript/node_modules/wrap-ansi/index.js from /home/runner/work/isaacscript/isaacscript/node_modules/nx/node_modules/yargs/node_modules/cliui/build/index.cjs not supported. #17229
Comments
This error doesn't really make sense, cliui does depend on |
Yes, I've tried nuking |
After regenerating the lockfile locally, it seemed to work for me. You can see the changes here: IsaacScript/isaacscript#57 |
To be clear, I was able to repro before regenerating the lockfile. I'm not sure how it was deduping v8 of wrap-ansi, that was invalid and It kind of seems like a package manager bug, but a nasty one that I'm not sure what would have caused. |
After merging your PR, we can still see the exact same error in CI: https://github.com/IsaacScript/isaacscript/actions/runs/5094206401/jobs/9157731090 |
Yeah, I saw that but can't really speak to it... If you pull down the commit SHA referenced in this issue, and run install its broken. Like I said, this seems like a really nasty issue with the package manager, its not something thats coming from Nx's side of things. This pattern reproduced for your repo on your CI, my machine, and a colleague's, but I don't think there is much more assistance we can provide. I'd recommend opening an issue on yarn's repo, and perhaps investigate updating some of your other packages. |
Thanks for taking the time to look into it Ender. For others reading this thread, I was able to solve the problem by upgrading from Yarn 1 to Yarn 3. (I'm not using plug-n-play, i.e. I'm still using the |
I was on Node 20 but rolled back to Node 18, still using Yarn 1 and seems to work. I also have Deleted all |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Nx crashes with an error.
Expected Behavior
Nx should run without an error.
Steps to Reproduce
git clone git@github.com:IsaacScript/isaacscript.git
cd isaacscript
git checkout a2ab4fdc399d00931561557e806bdee2f7ebcd74
yarn
npx nx report
You will get the following error:
Nx Report
I can't run nx report, I get the error listed above.
Failure Logs
No response
Operating System
Additional Information
You can see the error in the following GitHub Action run:
https://github.com/IsaacScript/isaacscript/actions/runs/5084290118/jobs/9136389446
The error seems to be because
nx
usescliui
, which tries to importwrap-ansi
.wrap-ansi
is supposed to be a CommonJS module, but is instead an ES module, causing the error.Thus, I believe that the issue will occur with any brand new installations of nx.
The text was updated successfully, but these errors were encountered: