Reputation: 11
I am working on a monorepo project using nx
and pnpm
. The project contains multiple packages, including @my-org/package1
and @my-org/package2
. I have set up a private GitLab package registry to publish and install these packages.
Here’s the workflow:
I published the @my-org/package2
package successfully to the private registry.
Now, I want to use @my-org/package2
as a dependency in the @my-org/package1
package for local development.
However, when I try to install the package in the @my-org/package1
project using pnpm
, I get the following error:
404 Not Found: @my-org/package2
Registry Configuration:
I added the following to my .npmrc
file:
@my-org:registry=https://gitlab.com/api/v4/projects/<project-id>/packages/npm/
//gitlab.com/api/v4/projects/<project-id>/packages/npm/:_authToken=<my-token>
always-auth=true
Verified the Package:
I ran pnpm view @my-org/package2
, and it shows the package with the correct version in the registry.
Local Linking:
I tried using workspace
in pnpm-workspace.yaml
:
packages:
- 'packages/*'
And added this dependency in @my-org/package1
’s package.json
:
"dependencies": {
"@my-org/package2": "^0.0.1"
}
Cleared Cache:
I ran pnpm store prune
and reinstalled all dependencies.
pnpm
nx
Why am I seeing a 404 error for the package, even though it is published and visible in the registry?
How can I set up my monorepo to use the @my-org/package2
package in @my-org/package1
for local development without this issue?
Upvotes: 1
Views: 56