Registry / azure / best-vsts-npm-auth

best-vsts-npm-auth

JSON →
library1.0.5jsnpmunverified

A CLI tool that refreshes Azure DevOps Artifacts and GitHub Packages npm authentication on your machine. It reads your project .npmrc, obtains an access token via Azure CLI (no app registration required), and writes short-lived tokens (valid ~1 hour) to your user ~/.npmrc and optionally project .yarnrc.yml. Current stable version is 1.0.5. Key differentiators: simple setup with no app registration, supports Yarn Berry, and works with scoped registries. Works on Node.js with Azure CLI.

npm install best-vsts-npm-auth
INSTALL
IMPORT
SIG · BEST-VSTS-NPM-AUTH
B
best-vsts-npm-auth
azurejavascriptv1.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AuthClient
import { AuthClient } from 'best-vsts-npm-auth'
const AuthClient = require('best-vsts-npm-auth')
ESM-only since v1.0.0
refreshToken
import { refreshToken } from 'best-vsts-npm-auth'
const refreshToken = require('best-vsts-npm-auth').refreshToken
ESM-only since v1.0.0
parseNpmrc
import { parseNpmrc } from 'best-vsts-npm-auth'
const { parseNpmrc } = require('best-vsts-npm-auth')
ESM-only since v1.0.0

Shows installation and common CLI usage to refresh npm authentication for Azure DevOps or GitHub Packages.

// Install globally npm i -g best-vsts-npm-auth # Run in project directory best-vsts-npm-auth . # Or specify .npmrc path best-vsts-npm-auth -n /path/to/.npmrc # Also update Yarn Berry config best-vsts-npm-auth -y ./.yarnrc.yml .
vsts-npm-auth --version
Debug
Known issues
gotchaAccess tokens are valid for approximately 1 hour. Re-run the tool if you see 401 errors.
fix
Run 'best-vsts-npm-auth' again to refresh tokens.
affects: >=0.0.0
gotchaTokens are written only to the user ~/.npmrc, not the project .npmrc, unless configured otherwise.
fix
Expect tokens in ~/.npmrc. Check project .npmrc for any overriding settings.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Azure CLI not found. Please install Azure CLI and login with 'az login'.
Azure CLI is not installed or not in PATH.
fix
Install Azure CLI from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli and run 'az login'.
Error: No registries found in .npmrc.
The provided .npmrc does not contain any registry entries.
fix
Ensure your .npmrc includes registry settings for Azure DevOps or GitHub Packages.
Error: Failed to refresh token. Check your Azure login status.
Azure CLI session expired or not logged in.
fix
Run 'az login' and then retry the tool.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
best-vsts-npm-auth — npm install best-vsts-npm-auth · libregistry