Invalid auth configuration found error when an update is found in a private npm artifacts feed
See original GitHub issueFollowing the update to 1.20 our pipeline encounters the following error when an update is found,
npm ERR! code ERR_INVALID_AUTH
npm ERR! Invalid auth configuration found: _auth must be renamed to //pkgs.dev.azure.com/our-org/_packaging/our-feed/npm/registry/:_auth in project config
npm ERR! Please run npm config fix to repair your configuration.`
We previously had dockerImageTag set to 0.18 and this was working up until recently when the image per ecosystem update kicked in forcing us to update to 1.20 so I can’t be sure whether we would have encountered the same error with 0.19.
Issue Analytics
- State:
- Created 2 months ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top Results From Across the Web
E401 - Unable to authenticate, your authentication token ...
I tested with Azure Packages private NPM server and now want to revert back to using the standard NPM registry but when I...
Read more >Fixing - E401 NPM Errors - Weekend Projects
Working with private NPM registries can encounter error codes such as E401 NPM error. We go over a few ways to fix this!...
Read more >[BUG] NPM v7 private registry authentication 401 (v6 works)
A complete log of this run can be found in: npm ERR! ... Unable to authenticate, your authentication token seems to be invalid....
Read more >How to connect and authenticate to NPM feeds on Azure ...
In order to update and download packages to a feed, you must access that Artifact page, click on Connect to feed and navigate...
Read more >Set up your client's npmrc - Azure Artifacts
Select Artifacts, and then select Connect to feed. Select npm from the left navigation pane. If this is the first time using Azure...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’re also seeing this problem after switching to 1.20+. In our configuration, we’re using Azure Artifacts as the only registry, with upstream feeds to npmjs et.al. Our .npmrc looks like:
This also means that every package in
package-lock.jsonwill have the above registry as theresolvedURL. From what I can deduce by looking at the npmrc_builder.rb file in dependabot-core, this means that this registry will be classified as aglobalregistry, see: https://github.com/dependabot/dependabot-core/blob/f9754d41004cb5a507b3cd4920fbf48551f9aced/npm_and_yarn/lib/dependabot/npm_and_yarn/file_updater/npmrc_builder.rb#L84This in turn leads to this part of the code https://github.com/dependabot/dependabot-core/blob/f9754d41004cb5a507b3cd4920fbf48551f9aced/npm_and_yarn/lib/dependabot/npm_and_yarn/file_updater/npmrc_builder.rb#L165 creating the following
.npmrc:This is a problem, because since NPM v8, all auth-related values need to be scoped, see: https://docs.npmjs.com/cli/v9/configuring-npm/npmrc?v=true#auth-related-configuration
A correct
.npmrcneeds to look like:My conclusion is that the problem lies in dependabot-core in that it no longer creates a compatible
.npmrcfor NPM > v8I’ve created an issue there, let’s see what the response is: https://github.com/dependabot/dependabot-core/issues/7759
I finally managed to get this working for me. In my case it helped to edit the .npmrc file in the project repo: non-working
.npmrc:working
.npmrc:npm-devops needs to be the same as the name of your registry in
dependabot.yml:of course you need to replace the ‘removed’ parts with your stuff Hope that this would work for you as well!
thanks @mburumaxwell for your sample files, they helped me with narrowing down what might be the issue!