jayarjo
jayarjo

Reputation: 16726

yarn workspace has problem with private npm registry

I'm trying yarn workspaces with modules that have private dependencies - so that there's a line like this specified in .npmrc:

//npm.pkg.github.com/:_authToken=this-is-some-fake-token

Token is obviously different. So when I run yarn from inside that module it grabs private modules just fine, however when I try to run it from the workspaces root, it fails with the error that it cannot find given private module on npm registry (but of course it can't - it probably shouldn't even be looking there):

error Couldn't find package "@namespace/[email protected]" required by "[email protected]" on the "npm" registry.

Obviously in this case yarn doesn't respect .npmrc that I've dropped in the workspaces root, but why? Or it is not even supposed to? And doesn't support private registries in workspaces mode?

Upvotes: 2

Views: 2359

Answers (1)

Anton
Anton

Reputation: 1638

Yarn will respect .npmrc from your home directory (not 100% sure about monorepo root).

What you are for sure missing in your .npmrc is the line that mentions that @namespace packages should be picked from GPR:

//npm.pkg.github.com/:_authToken=this-is-some-fake-token
@namespace:registry=https://npm.pkg.github.com/

Upvotes: 1

Related Questions