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

[BUG] npm config set [key] [value] modifies values of other [key]s #2072

Closed
ghost opened this issue Oct 28, 2020 · 2 comments
Closed

[BUG] npm config set [key] [value] modifies values of other [key]s #2072

ghost opened this issue Oct 28, 2020 · 2 comments
Labels
Bug thing that needs fixing Release 6.x work is associated with a specific npm 6 release

Comments

@ghost
Copy link

ghost commented Oct 28, 2020

Current Behavior:

When using npm config set, npm sometimes modifies previously set values in the .npmrc not specified in the call, such as environment variable names.

Expected Behavior:

Running npm config set [key] [value] should only modify the value of [key] in the .npmrc.

Steps To Reproduce:

Observe the following commands in a Windows 10 command prompt with environment variables CUSTOM_ENV_ONE and CUSTOM_ENV_TWO. The .npmrc is empty to begin with.

>echo %CUSTOM_ENV_ONE%
1234

>echo %CUSTOM_ENV_TWO%
5678

>type %USERPROFILE%\.npmrc

>npm config set blah1 ${CUSTOM_ENV_ONE}

>type %USERPROFILE%\.npmrc
blah1=${CUSTOM_ENV_ONE}

>npm config set blah2 ${CUSTOM_ENV_TWO}

>type %USERPROFILE%\.npmrc
blah1=1234
blah2=${CUSTOM_ENV_TWO}

Notice how blah1 was changed from ${CUSTOM_ENV_ONE} to 1234 on the npm config set blah2 ${CUSTOM_ENV_TWO} call. This looks like a bug.

Environment:

  • OS: Windows 10 Pro 19042.572
  • Node: 14.5.0
  • npm: 6.14.8
@ghost ghost added Bug thing that needs fixing Needs Triage needs review for next steps Release 6.x work is associated with a specific npm 6 release labels Oct 28, 2020
@ghost ghost changed the title [BUG] <title> [BUG] <npm config set [key] [value] modifies values of other [key]s> Oct 28, 2020
@ghost ghost changed the title [BUG] <npm config set [key] [value] modifies values of other [key]s> [BUG] npm config set [key] [value] modifies values of other [key]s Oct 28, 2020
@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Feb 13, 2021
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

1 similar comment
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 6.x work is associated with a specific npm 6 release
Projects
None yet
Development

No branches or pull requests

1 participant