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

Installing packages bumps hash for unrelated git packages in lock file #7008

Closed
2 of 4 tasks
dangmai opened this issue Aug 30, 2023 · 2 comments · Fixed by #7054
Closed
2 of 4 tasks

Installing packages bumps hash for unrelated git packages in lock file #7008

dangmai opened this issue Aug 30, 2023 · 2 comments · Fixed by #7054

Comments

@dangmai
Copy link

dangmai commented Aug 30, 2023

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

No response

Which area(s) of pnpm are affected? (leave empty if unsure)

Lockfile

Link to the code that reproduces this issue or a replay of the bug

https://github.com/dangmai/pnpm-lib-1

Reproduction steps

You can run the following commands after cloning my repository:

pnpm i
pnpm add express
git diff

Observe that the lockfile shows that the dependency dangmai/pnpm-dep-1 has been bumped up in the lockfile.

Describe the Bug

If you're using a git dependency with a mutable identifier (for example, #main), any install or update commands lead to its version getting bumped up in the lockfile.

Expected Behavior

Commands that deal with specific packages shouldn't affect other packages.

Which Node.js version are you using?

v16.20.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

Ubuntu

@await-ovo
Copy link
Member

It does look like a bug here. Tested it with npm@8.11.0 and yarn@3.6.3, git-protocol dependency will not changed after add express.

@RoyRao2333
Copy link

RoyRao2333 commented Sep 26, 2023

@await-ovo @zkochan

Is this already fixed? I can still reproduce this issue by calling pnpm add xxx@latest. A lot of packages' dependency added a hash for no reason:

image

But if I remove all local node_modules and call pnpm store prune, then manually edit the package's version in package.json, the lockfile will be alright by calling pnpm install rather than pnpm add xxx@latest.

nachoaldamav pushed a commit that referenced this issue Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants