Lesstep
Azure Artifacts · npm · Checked November 6, 2026

Azure Artifacts: npm "E401 Unable to authenticate, need: Bearer authorization_uri=…"

When npm asks an Azure Artifacts feed for a package without a credential the feed accepts, the feed answers 401 and lists the ways it would take one: a Bearer token, Basic with a personal access token, or TFS-Federated. npm prints that list. It almost never means the feed is down; it means npm sent nothing usable for that address (a Stack Overflow question on this message has been seen over 170,000 times).

When npm install fails in a pull request's build validation, the pull request waits on it: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, lists the pull request's branch policies with their state in your IDE, and with Pro runs a failed build policy again once the feed lets the build in. Get it on JetBrains Marketplace

What it looks like

npm matches credentials by address

Windows: vsts-npm-auth

macOS, Linux, or no vsts-npm-auth: a personal access token

In a pipeline: npmAuthenticate before npm install

Azure DevOps pull requests in IntelliJ IDEA and Rider

Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It shows the branch policies of a pull request with their state, so a required build that has not passed is next to its pull request, and with Pro you run a failed or expired build policy again from there. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial.

Get it on JetBrains Marketplace

Azure DevOps, Azure Artifacts and Azure Pipelines are trademarks of Microsoft Corporation; npm is a trademark of npm, Inc.; IntelliJ IDEA and Rider are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft, npm, Inc. or JetBrains.

More: pip: 401 Error, Credentials not correct for · NuGet: Unable to load the service index for source · checkout stops with Git fetch failed with exit code: 128 · VS800075: the build service cannot see the project · 日本語