I am working with a very simple monorepo with the following structure:
.npmrc
package.json
pnpm-workspaces.yml
packages/
package-1/
package-2/
When I cd into package-1, I am trying to add a reference to package-2 by doing the following:
pnpm add @myorg/package-2
But I get the error @myorg/package-2 is not in the npm registry, or you have no permission to fetch it.. I expect that pnpm add would detect that I'm inside a workspace and automatically link workspace packages. Am I missing something here?
Here is the relevant information you should need:
- My packages use the
@myorg/[package-name]convention inside of package.json "name" field. - The pnpm-workspaces.yml file is as follows:
packages: - 'packages/**' - My .npmrc file is as follows:
link-workspace-packages = true prefer-workspace-packages = true recursive-install = true