Reputation: 11
I have an artifact on ADO with published package @foo/bar
I followed the install instruction with
one user .npmrc containing links, usernames, base-64 encoded pat token generated by ADO "install package" documentation, filling in the requisite fields
; begin auth token
//pkgs.dev.azure.com/[org name]/[project id]/_packaging/[artifact feed name]/npm/registry/:username=[username]
//pkgs.dev.azure.com/[org name]/[project id]/_packaging/[artifact feed name]/npm/registry/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/[org name]/[project id]/_packaging/[artifact feed name]/npm/registry/:email=[email]
//pkgs.dev.azure.com/[org name]/[project id]/_packaging/[artifact feed name]/npm/:username=[username]
//pkgs.dev.azure.com/[org name]/[project id]/_packaging/[artifact feed name]/npm/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/[org name]/[project id]/_packaging/[artifact feed name]/npm/:email=[email]
; end auth token
one package - based .npmrc file containing the scope-prefaced registry
@foo:registry=https://pkgs.dev.azure.com...
always-auth=true
I cloned project 'baz', cd'd into the directory and ran `npm install @foo/bar
Received 401 unauthorized when trying to install the package
I was expecting the package @foo/bar to be installed and listed in the package.json file
I tried:
Upvotes: 1
Views: 23
Reputation: 13944
To restore (read) packages from an Azure Artifacts feed, you need to check if you have the following permissions:
Since the Artifacts feed is project-scoped, ensure you have been added as a member of the corresponding project so that you have at least the Reader
role permission in the project.
In the Artifacts feed, go to "Feed Settings" > "Permissions", ensure you (or the group where you are a member) have at least the Feed Reader
role assigned.
When you create/edit a PAT (Personal Access Token) for accessing the Artifacts feed, ensure the PAT has at least Packaging (Read)
scope.
Then you can following steps mentioned in "Connect your npm project to Azure Artifacts" to configure the project .npmrc
and user .npmrc
.
Upvotes: 0