Description
Current Behavior:
Given a config command like this:
npm config set '//gitlab.vendor.com/api/v4/packages/npm/:_authToken' "-iF_9eLYJkB2a3simuB1"
It silently fails to set the configuration key. The command returns 0 while the key turns out to be empty in .npmrc.
My suspect is that -iF_9eLYJkB2a3simuB1 ends up being considered a command line option instead of a positional argument. This is somewhat confirmed by explicitly using -- to tell npm not to search for more options, which brings the expected behaviour back. Another workaround is to use the (apparently undocumented) syntax:
npm config set "//gitlab.vendor.com/api/v4/packages/npm/:_authToken=-iF_9eLYJkB2a3simuB1"
Still, IMO, silently ignoring the value is not the correct behaviour. We should probably at least complain about an invalid option instead.
Expected Behavior:
Either the configuration key is correctly assigned the given value, or the command fails due to an invalid -iF_9eLYJkB2a3simuB1 option.
Steps To Reproduce:
ex. steps to reproduce the behavior:
- with
npmv6, v7, or latest - run
npm config set '//gitlab.vendor.com/api/v4/packages/npm/:_authToken' "-iF_9eLYJkB2a3simuB1" - check your
.npmrccontent for the above key and verify it's empty:
//gitlab.vendor.com/api/v4/packages/npm/:_authToken=