-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 replaces environment variables in .npmrc #6183
Comments
This is not an npm problem it is a shell problem. You need to escape the bash-3.2$ npm config set //custom-server/:_authToken "${FOO}"
bash-3.2$ tail -1 ~/.npmrc
//custom-server/:_authToken=test
bash-3.2$ npm config set //custom-server/:_authToken "\${FOO}"
bash-3.2$ tail -1 ~/.npmrc
//custom-server/:_authToken=${FOO} |
@wraithgar unfortunatelly it doesn't fix anything - it still replaces a completely unrelated value in the config:
|
I can confirm that the problem described exists
|
When ${X} values are read from an rc file, those values should be written back as-is when config is re-saved Fixes #6183
When ${X} values are read from an rc file, those values should be written back as-is when config is re-saved Fixes #6183
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm config replaces all environment variables variables in
~/.npmrc
, e.g.:As you can see this line (completely unrelated to the invoked
npm config
command):for some reason is being replaced with an actual variable value:
Expected Behavior
npm config should not touch variables and lines of config completely unrelated to the invoked command, so line
should remain intact.
Steps To Reproduce
No response
Environment
debian:bullseye
docker image.The text was updated successfully, but these errors were encountered: