From f5cd325e0f7caea0552112f2149fc5214d1cfb25 Mon Sep 17 00:00:00 2001 From: Jonathan Creamer Date: Wed, 17 Apr 2024 14:30:47 -0500 Subject: [PATCH] Update README.md --- packages/ado-npm-auth/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ado-npm-auth/README.md b/packages/ado-npm-auth/README.md index 14ac524..be80572 100644 --- a/packages/ado-npm-auth/README.md +++ b/packages/ado-npm-auth/README.md @@ -12,6 +12,14 @@ You can run the binary `"ado-npm-auth"` via `yarn ado-npm-auth` or `npm exec ado It will then shell out to the `azureauth` package on [npm](https://www.npmjs.com/package/azureauth), retrieve a token, and update your `~/.npmrc`. +## Beware the chicken and egg problem + +You may need to set the registry to the public NPM feed when running `npm exec` or `npx`. + +If that's the case, set the environment variable `npm_config_registry=https://registry.npmjs.org`. + +That will ensure that `npx` or `npm exec` grabs from the public NPM feed, bypassing the soon-to-be authenticated ADO feed. + ## ado-npm-auth vs vsts-npm-auth The main difference between the two is how they function, and where they can run. The `vsts-npm-auth` tool is Windows only, and uses MSAL authentication. @@ -32,4 +40,4 @@ One of the easiest ways to use the tool is to add it to your `"preinstall"` scri It will then perform a quick "pre-flight" check to assess if the token is valid, and generate a new one if it has expired. -![screenshot of tool running via preinstall](https://github.com/microsoft/ado-npm-auth/raw/main/packages/ado-npm-auth/static/preinstall.png) \ No newline at end of file +![screenshot of tool running via preinstall](https://github.com/microsoft/ado-npm-auth/raw/main/packages/ado-npm-auth/static/preinstall.png)