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

print how to upgrade pnpm when packageManager version doesn't match #8086

Open
1 task
benmccann opened this issue May 15, 2024 · 1 comment
Open
1 task

Comments

@benmccann
Copy link

benmccann commented May 15, 2024

Contribution

Describe the user story

I set "packageManager": "pnpm@9.1.1" in my project while having pnpm 9.1.0 installed and got:

$ pnpm install 
 ERR_PNPM_BAD_PM_VERSION  This project is configured to use v9.x of pnpm. Your current pnpm is v9.1.0

If you want to bypass this version check, you can set the "package-manager-strict" configuration to "false" or set the "COREPACK_ENABLE_STRICT" environment variable to "0"

But it doesn't tell me how to upgrade my pnpm version, which would be the other solution.

Describe the solution you'd like

The upgrade box should be printed still so that I can reference how to upgrade:

   ╭─────────────────────────────────────────────────────────────────╮
   │                                                                 │
   │                Update available! 9.1.0 → 9.1.1.                 │
   │   Changelog: https://github.com/pnpm/pnpm/releases/tag/v9.1.1   │
   │                Run "pnpm add -g pnpm" to update.                │
   │                                                                 │
   │     Follow @pnpmjs for updates: https://twitter.com/pnpmjs      │
   │                                                                 │
   ╰─────────────────────────────────────────────────────────────────╯

An alternative and preferable solution would be to stop enforcing package-manager-strict similar to how pnpm 8 worked or make package-manager-strict=false the default. See #8087 for that

Describe the drawbacks of your solution

No drawbacks to printing the upgrade instructions

Changing to package-manager-strict=false would have more trade-offs

Describe alternatives you've considered

It would also be helpful to have docs describing how this stuff is supposed to interact. I have to put the packageManager field in my package.json in order to deploy on Netlify, but it's become a hugely massive pain now for developing locally since the latest major version of pnpm

@zkochan
Copy link
Member

zkochan commented May 16, 2024

It would also be helpful to have docs describing how this stuff is supposed to interact. I have to put the packageManager field in my package.json in order to deploy on Netlify, but it's become a hugely massive pain now for developing locally since the latest major version of pnpm

I guess you could put package-manager-strict=false in the root .npmrc of your project. It wouldn't matter to Netlify I suppose.

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

No branches or pull requests

2 participants