How to set registry for namespaced package with yarn?

2.2k Views Asked by At

I am giving yarn a try as a replacement for npm.

For npm, we use both a private sinopia registry and for some namespaced package the official repoistory as well, as sinopia doesn't handle the namespace.

Since my .npmrc has these registries defined.

registry=http://sinopia-registry.internal:4873/
@types:registry=https://registry.npmjs.org

I know that I can set the registry globally in yarn in its .yarnrc via:

registry "http://sinopia-registry.internal:4873/"

Yet how to I tell yarn to use a different registry form @types namespaced packages?

I tried different approaches on the lines of:

registry @types "https://registry.npmjs.org/"

Yet they all lead to yarn to complain about syntax errors.

1

There are 1 best solutions below

0
On

Try instead using:

"@types:registry" "https://registry.npmjs.org"