-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] 10.4 and later: $npm_package_config_* variables no longer work for arrays #7343
Comments
@Twipped It can be accessed as |
I understand that, but the behavior where the array was coerced into arguments has vanished, and it broke some of our workflows. |
@Twipped This is not a bug and it's expected behaviour and those values can be accessed as |
Did you read any of what I wrote? The behavior I'm referencing did not change in v7, it changed in 10.4 with the change of npm version released in node 18.19 and 18.20, and I gave you a reproduction of that exact change. I am not talking about referencing individual items in the array, I'm talking about referencing the array as a whole. You released a breaking change as a minor update. |
@milaninfy Prior to the latest patch version change the behavior worked. I am surprised that no one in the pull request called this interface change out as the breaking change that it is. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
In our package.json we have an array of values that we access via environment variables in our npm scripts. Example:
Under 10.4 and 10.5, the
$npm_package_config_foo
variable is either empty, or isn't defined.Expected Behavior
Under npm 10.2 and 10.3, arrays would be concatenated into a space separated list.
Running
npm run echo
outputs:Steps To Reproduce
I have created a codesandbox with an example. https://codesandbox.io/p/devbox/dnkx8d
Running
nvm i 18.19
will get you npm 10.2.4, andnvm i 18.20
will get you npm 10.5.0.In my local debugging I confirmed the change was between 10.3 and 10.4.
Environment
The text was updated successfully, but these errors were encountered: