Skip to content
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

fix: keep NODE_OPTIONS unset when the calculated value is empty #6255

Merged

Conversation

DanielRose
Copy link
Contributor

Also update the type of the process-environment to NodeJS's, which allows undefined as valid value.

What's the problem this PR addresses?

Resolves #6148

How did you fix it?

If the calculated NODE_OPTIONS value is an empty string, set the environment value to undefined.

Since the original definition of the process-environment did not allow undefined, I changed the type definition to use NodeJS.ProcessEnv. Otherwise the code would need to be written as

env.NODE_OPTIONS = nodeOptions ? nodeOptions : undefined as unknown as string;

I haven't figured out where this could be tested, so I did not add/update any unit tests.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

DanielRose and others added 3 commits April 29, 2024 17:25
@arcanis arcanis merged commit 96e8b3c into yarnpkg:master May 6, 2024
22 of 26 checks passed
@DanielRose DanielRose deleted the fix-node-options-set-to-empty-string branch May 6, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Yarn@4 sets NODE_OPTIONS to empty string instead of undefined (as yarn@3 does)
2 participants