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

Package name mismatch with workspace package #4565

Closed
jondlm opened this issue Apr 13, 2022 · 0 comments · Fixed by #4580
Closed

Package name mismatch with workspace package #4565

jondlm opened this issue Apr 13, 2022 · 0 comments · Fixed by #4580
Assignees
Milestone

Comments

@jondlm
Copy link
Contributor

jondlm commented Apr 13, 2022

  • pnpm version: bug first showed up in 6.32.2, also present in v7.0.0-rc.3
  • node -v prints: 16.14.0
  • Windows, macOS, or Linux?: macOS

Code to reproduce the issue:

I'm fairly certain the issue was introduced in #4395 as the bug doesn't show up with 6.32.1 (before that PR). My step debugging indicates that update is being incorrectly set to true in resolveDepedencies.ts because of this check.

-> repo with a minimal reproduction

Repro with pnpm --filter a add is-negative

Pseudo workspace layout:

a/
  package.json -> { name: a, dependencies: { lodash: ^4.16.0 } }
b/
  package.json -> { name: b, dependencies: { lodash: ^4.17.0 } }
lodash/
  package.json -> { name: lodash, version: 4.17.21 }

.npmrc

# Bug only presents itself with this set to false
link-workspace-packages=false

pnpm-lock.yaml

lockfileVersion: 5.3

importers:

  .:
    specifiers: {}

  a:
    specifiers:
      lodash: ^4.16.0
    dependencies:
      lodash: 4.17.20

  b:
    specifiers:
      lodash: ^4.17.0
    dependencies:
      lodash: 4.17.21

packages:

  /lodash/4.17.20:
    resolution: {integrity: sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==}
    dev: false

  /lodash/4.17.21:
    resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
    dev: false

pnpm-workspace.yaml

packages:
  - 'a'
  - 'b'
  - 'lodash'

Expected behavior:

Packages is added cleanly without error.

Actual behavior:

Pnpm fails with this error:

Package name mismatch found while reading {"integrity":"sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==","registry":"https://registry.npmjs.org/","tarball":"https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"} from the store. This means that the lockfile is broken. Expected package: lodash@4.17.20. Actual package in the store by the given integrity: lodash@4.17.21.

seo (my personal name for the bug): air-idiom

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.

2 participants