Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twice install doesn't skip resolution step #6592

Closed
tjx666 opened this issue May 25, 2023 · 2 comments · Fixed by #6791
Closed

twice install doesn't skip resolution step #6592

tjx666 opened this issue May 25, 2023 · 2 comments · Fixed by #6791

Comments

@tjx666
Copy link

tjx666 commented May 25, 2023

pnpm version: 8.5.1

Code to reproduce the issue:

github repository: https://github.com/tjx666/pnpm-issue-workspace-version
online: https://stackblitz.com/edit/github-yaxxsn?file=packages%2Ffoo%2Fpackage.json

Expected behavior:

  1. pnpm install
  2. pnpm install again will output Lockfile is up to date, resolution step is skipped

Actual behavior:

no output Lockfile is up to date, resolution step is skipped

Additional information:

  • node -v prints: 18.16.0
  • Windows, macOS, or Linux?: MacOS

After I debug code, I find this issue is because https://github.com/pnpm/pnpm/blob/main/pkg-manager/core/src/install/allProjectsAreUpToDate.ts#L117 doesn't consider version number like workspace.

You can see my foo package pakcage.json definition:

{
    "name": "foo",
    "dependencies": {
         // "bar": "workspace:*" works fine.
        "bar": "workspace",
        "lodash": "^4.17.21"
    }
}
@zkochan
Copy link
Member

zkochan commented May 26, 2023

It should have failed with an error on the first install. workspace is not a supported syntax to reference local workspace projects. workspace means install a version under the workspace dist-tag.

@await-ovo
Copy link
Member

The first installation now treats 'workspace' as a dist-tag, and if the tag is not found in the registry, it will try to find the corresponding package from the local workspaces.

Maybe we need to fix the resolution issue on the second install?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants