Closed kwickramasekara closed 4 months ago
As a workaround, I'v updated our project readme to run this before the npm install
on fresh clones of the repo:
npm_config_registry=https://registry.npmjs.org npm i -g ado-npm-auth && npm exec ado-npm-auth && npm un -g ado-npm-auth
It installs the ado-npm-auth
package globally using the public registry, obtains a PAT and uninstalls the package. This ensures a valid token exists before the npm install
.
Hey all, thanks for this amazing tool. We started using it today but are running into an issue with the
preinstall
setup mentioned in the docs. In a repository with a private registry, it looks like you need to already have a PAT saved locally for thepreinstall
script to successfully run. Otherwise, you get the following error:This means, the tool won't be able to generate a new PAT for you? An example scenario for this case would be someone cloning and setting up the said repository for the first time with no pre-existing PATs.
Note: to reproduce the issue, you may need to clear the npm cache (
npm cache clean --force
).Edit: I see there is a section about this in the docs, but it still doesnt work when I set the
preinstall
script to:npm_config_registry=https://registry.npmjs.org npm exec ado-npm-auth