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.json keeps my pnpm version artificially old #587

Open
hyperknot opened this issue Dec 27, 2024 · 1 comment
Open

package.json keeps my pnpm version artificially old #587

hyperknot opened this issue Dec 27, 2024 · 1 comment

Comments

@hyperknot
Copy link

I opened this issue in pnpm but it seems it's more related to corepack.

https://github.com/orgs/pnpm/discussions/8911#discussioncomment-11674247

Copying it here:


  1. I go to any repo, with package.json
  2. I run pnpm i
  3. It adds this "packageManager": "[email protected]+sha512...." line
  4. From now on: 1. it keeps annoying me with the "Please update pnpm with corepack" notice AND 2. it doesn't get updated.

By "doesn't get updated" I mean that even though I've updated my pnpm to the latest version, when I go inside that directory, it reports it as 9.10, not as 9.15.

Even though I'm running on the very same binary file!

Outside the project repo:

/Users/user/.nvm/versions/node/v20.17.0/bin/pnpm --version
9.15.1

Inside the project repo:

/Users/user/.nvm/versions/node/v20.17.0/bin/pnpm --version
9.10.0

This is extremely buggy / confusing like this. How can the same binary file have multiple versions?

@arcanis
Copy link
Contributor

arcanis commented Dec 27, 2024

This is extremely buggy / confusing like this. How can the same binary file have multiple versions?

That's literally the point of Corepack. It uses the version configured for a given project, not whatever random version happens to be globally installed. The binary you see is not the final one. The final ones are in ~/.cache/node/corepack/pnpm, and which one is used depends on the packageManager field.

So if you want to upgrade pnpm, just do what pnpm says; it'll upgrade the packageManager field.

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

No branches or pull requests

2 participants