Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set registry for namespaced package with yarn?

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.

like image 901
k0pernikus Avatar asked Nov 08 '22 05:11

k0pernikus


1 Answers

Try instead using:

"@types:registry" "https://registry.npmjs.org"
like image 175
Brady Dowling Avatar answered Nov 14 '22 22:11

Brady Dowling