pnpm / pnpm

Fast, disk space efficient package manager
https://pnpm.io
MIT License
29k stars 971 forks source link

Regression: `pnpm link` with workspace references fails #6603

Open thantos opened 1 year ago

thantos commented 1 year ago

pnpm version: 8.6.0

Code to reproduce the issue:

https://github.com/functionless/eventual/blob/main/apps/tests/aws-runtime/scripts/test-create

Test script that links workspace packages over a local install.

Expected behavior:

link should succeed. It succeeded with 8.5.1 and has worked since 6.* at least.

https://github.com/functionless/eventual/actions/runs/5100583453/jobs/9169107938#step:4:23

Actual behavior:

Github action picked up the latest 8.6.0 and now throws this error:

 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In ../../../../../packages/@eventual/core-runtime: "@eventual/core@workspace:^" is in the dependencies but no package named "@eventual/core" is present in the workspace

https://github.com/functionless/eventual/actions/runs/5104922608/jobs/9176183671?pr=379#step:4:25

Additional information:

thantos commented 1 year ago

Workaround: Pinning the version https://github.com/functionless/eventual/pull/379/commits/41a32f6710f6760ca5c4b9625d149fa722ea086f

segevfiner commented 1 year ago

Also in v7.33.0

zkochan commented 1 year ago

ok, can someone create a smaller repository that reproduces the issue. I don't understand what is happening.

This change might be related: https://github.com/pnpm/pnpm/pull/6598

kiuKisas commented 1 year ago

I came to this issue because that happen to me in version 7.1.9. However, after updating to 8.6.1, the error message was:

 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "iris@workspace:*" is in the dependencies but no package named "iris" is present in the workspace

It became clearer that my problem was a bad name in the name field inside the package.json of my package. Updating it solve my issue.

Probably not @thantos issue, but I hope it can help some people and detect false cases.

RichardJECooke commented 10 months ago

I'm not sure if this is the same error, but I ran npm install -g pnpm;, then tried pnpm install on a client's repository, and I get the error ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "@speakeasy/nextra-theme@workspace:*" is in the dependencies but no package named "@speakeasy/nextra-theme" is present in the workspace. Is this this bug, or is there some setup step I need to do after installing pnpm please?

faiz-gear commented 9 months ago

I'm not sure if this is the same error, but I ran npm install -g pnpm;, then tried pnpm install on a client's repository, and I get the error ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "@speakeasy/nextra-theme@workspace:*" is in the dependencies but no package named "@speakeasy/nextra-theme" is present in the workspace. Is this this bug, or is there some setup step I need to do after installing pnpm please?

I got the same error, did you find a way to resolve it?

ThomasBouasli commented 7 months ago

I came to this issue because that happen to me in version 7.1.9. However, after updating to 8.6.1, the error message was:

 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "iris@workspace:*" is in the dependencies but no package named "iris" is present in the workspace

It became clearer that my problem was a bad name in the name field inside the package.json of my package. Updating it solve my issue.

Probably not @thantos issue, but I hope it can help some people and detect false cases.

What do you mean a name problem? I got the same error.

shellscape commented 7 months ago

@zkochan would be cool to get this one on the priority list. currently preventing me from setting up a proper test environment for CI for jsx-email. Looks like https://github.com/pnpm/pnpm/issues/6603#issuecomment-1733599973 provides a solid reproduction.

cope commented 3 months ago

Just got the same ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "@swc/types@workspace:^" is in the dependencies but no package named "@swc/types" is present in the workspace out of the blue after trying to upgrade packages with pnpm latest.

EDIT: Found this, might be related: https://github.com/swc-project/swc/issues/8988

Teygeta commented 1 month ago

Are you sure you have pnpm-workspace.yaml in your project?