-
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] package.json#/config/*: Array
changed behaviour to joining items with double new-line
#3775
Comments
package.json#/config/*: Array
changed behaviour to joining items with double new-line
Same for npm v7.24.0 Nothing in docs https://docs.npmjs.com/cli/v7/configuring-npm/package-json#config |
Hi @askirmas, After looking deeply into this issue here's a few things I found out... FindingsThe v7 changes to the The section references RFC 21 (Reduce the environment variables provided to lifecycle scripts) which talks about the changes and the motivation behind them. WorkaroundFor your case, you can achieve the 1. Previously:{
"config": {
"array": ["item1", "item2", "item3"]
}
}
{
"npm_package_config_array": "item1\n\nitem2\n\nitem3"
} 2. Equivalent (solution){
"config": {
"array": {
"0": "item1",
"1": "item2",
"2": "item3"
}
}
}
{
"npm_package_config_array_0": "item1",
"npm_package_config_array_1": "item2",
"npm_package_config_array_2": "item3"
} ProgressThere's however need to have these changes reflected on the documentation (still exploring the justification for the change), or revert the part that causes the double new-line. I'm currently actively working on this issue and these are currently in progress. |
Reverts environment parsing of config arrays to use indexed names instead of joining them with double newlines. That change appears to have been introduced when the enviromnent values were added back into npm, but not in the same way they were done before. Fixes: npm/cli#3775 --------- Co-authored-by: siemhesda <143130929+siemhesda@users.noreply.github.com>
Is there an existing issue for this?
Current Behavior
package.json
process.env
Expected Behavior
process.env
(Like it was at v6):Steps To Reproduce
npm start
Environment
The text was updated successfully, but these errors were encountered: