Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Uses NODE_OPTIONS with PnP instead of CLI args #6629
A common problem people currently have is with programs that call Node through the
In order to alleviate this issue, this diff makes Yarn switch from passing the
An alternative would be to monkey-patch the
Since relying on the environment is sometimes tricky, I'd appreciate having a few set of eyes take a look at this diff before I merge it - just to be sure I don't miss something (cc @yarnpkg/core).
Also cc @jdalton (since that might maybe affect
Note: This PR has one problem, though: it might cause issues for people having spaces into their project path. This is caused by a bug/oversight in the way Node parses the NODE_OPTIONS value. I've work on a PR to fix it on their side (nodejs/node#24065), but that might cause some pain in the meantime. I could potentially add a warning when it happens, but it will still be displayed once the problem is solved - I'm not sure whether it's a good UX or not.
Added tests, the existing one should pass as before
BYK left a comment
Looks good. I'd love to see two follow ups: