Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When npm config set is provided with value that starts with "-", it ignores this value and sets an empty string instead.
This is a serious issue for us, as some tokens can generate starting with "-".
Bug case:
y-golubev:~ y.golubev$ npm -v
8.5.5
y-golubev:~ y.golubev$ npm config set "foo" "-bar"
y-golubev:~ y.golubev$ npm config list
...
foo = ""
Expected Behavior
Instead, it should just set the provided value.
Expected:
y-golubev:~ y.golubev$ npm -v
8.5.5
y-golubev:~ y.golubev$ npm config set "foo" "-bar"
y-golubev:~ y.golubev$ npm config list
...
foo = "-bar"
That's the way it works with all other values.
Steps To Reproduce
Works the same with basically any npm version.
Run:
npm config set "foo" "-bar"
npm config list | grep foo
Outputs foo = ""
Environment
- npm: 8.5.5
- Node.js: v17.8.0
- OS Name: macOS 10.14.6
- System Model Name: Macbook Pro
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When
npm config setis provided with value that starts with "-", it ignores this value and sets an empty string instead.This is a serious issue for us, as some tokens can generate starting with "-".
Bug case:
Expected Behavior
Instead, it should just set the provided value.
Expected:
That's the way it works with all other values.
Steps To Reproduce
Works the same with basically any npm version.
Run:
Outputs
foo = ""Environment