We have an NPM package say 'design' in say organization1, I have a pipeline which is part of the same organization that is able to resolve the package with just npmrc file. I wanted to access the packages 'design' from organization2, I am not able to read/resolve the package. pipeline throws 401.
- I tried setting up Service connection in Azure devops and try to use - same response
- tried with PAT directly on the npmrc file - same response
- From this blog, we have to set up all the properties, I tried - same response.
Is there I have to do something else to resolve the packages in external organization ?
latest .npmrc
@<reg>:registry=https://<reg>.pkgs.visualstudio.com/_packaging/<feed>/npm/registry/
//https://<reg>.pkgs.visualstudio.com/_packaging/<feed>/npm/registry/:_password=#{npm_PAT}#
//https://<reg>.pkgs.visualstudio.com/_packaging/<feed>/npm/registry/:username="notrequired"
//https://<reg>.pkgs.visualstudio.com/_packaging/<feed>/npm/registry/:email="[email protected]"
//https://<reg>.pkgs.visualstudio.com/_packaging/<feed>/npm/registry/:always-auth = true
To resolve the packages in external organization, you can add the following content to .npmrc file:
Project feed:
Organization Feed:
Then you need to create a PAT with the Packaging Read and Write permission of the organization1.
Note: You need to convert the PAT to base64 type and replace the token value in .npmrc file.
To get the detailed settings, you can navigate to Azure Feed -> Connect to feed -> NPM -> Other and check the .npmrc file settings.
Update:
To convert the PAT to base64 type, we can follow this doc: Credentials setup