Users may authenticate using the .npmrc snippet available in the “Set Me Up” section of the repository. In this case, the configuration snippet that Artifactory generates is no longer valid. The configuration snippet will look similar to this:
registry=https://elinaf.jfrog/artifactory/api/npm/dev-npm/ _auth=<USER>:<PASSWORD> (converted to base 64) email=youremail@email.com always-auth=true
Attempts to install npm packages while authenticated with the above configuration will result in the following error:
npm ERR! code ERR_INVALID_AUTH npm ERR! Invalid auth configuration found: `_auth` must be renamed to `//elinaf.jfrog/artifactory/api/npm/dev-npm/:_auth` in user config npm ERR! Please run `npm config fix` to repair your configuration.`
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-11-16T12_02_05_084Z-debug-0.log
Running npm config fix will repair the configuration and update it to use the new format, in which the _auth information is no longer presented in a separate line, but is now part of the URL as follows:
email=user@t.com always-auth=true registry=https://elinaf.jfrog/artifactory/api/npm/dev-npm/ //elinaf.jfrog/artifactory/api/npm/dev-npm/:_auth=<base_64_user:password>
The .npmrc snippet can be also retrieved by running a cURL request to the following endpoint:
$ curl https://ART_HOST/artifactory/api/npm/auth
This will return the configuration snippet which will then need to be modified to match the new structure.
Note: Users that are already logged in are not affected.