Search code examples
azure-devopsyarnpkgazure-artifactsyarnpkg-v2

How to use registry scopes with Yarn 2.0 and Azure Artifacts


I would like to use https://registry.yarnpkg.com as my package registry for all packages except 1 that I am hosting on Azure Artifacts.

I have the following .yarnrc.yml file

yarnPath: ".yarn/releases/yarn-berry.js"    
npmScopese:
      my-scope:
        npmRegistryServer: 'https://pkgs.dev.azure.com/<my-org>/_packaging/<my-feed>/npm/registry/'
        npmAlwaysAuth: true
        npmAuthIdent: 'my-auth-stuff'

then in the console I run yarn add @my-scope/[email protected]

I get the following error @my-scope/my-package@npm:1.0.0: Response code 404 (Not Found)

The following returns a 200 response

curl GET 'https://pkgs.dev.azure.com/<my-org>/_packaging/<my-feed>/npm/registry/<my-package>' --header 'Authorization: <my-auth>'

Not sure if am missing something. Any help would be appreciated.


Solution

  • For anybody who comes across this I solved it by changed my package name to @my-scope/my-package in artifacts.