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

Cannot update pnpm after downgrade #6660

Closed
pitgrap opened this issue Jun 9, 2023 · 2 comments
Closed

Cannot update pnpm after downgrade #6660

pitgrap opened this issue Jun 9, 2023 · 2 comments

Comments

@pitgrap
Copy link
Contributor

pitgrap commented Jun 9, 2023

I updated to pnpm 8.6.1 and used it in a workspace. Everything worked.
After that, I had to downgrade to 8.5.1 for an older project (pnpm i -g pnpm@8.5.1). Everything worked.

Now I want to go back to 8.6.1 but I get the following error:

❯ pnpm i -g pnpm@8.5.1
 WARN  Your pnpm-lock.yaml was generated by a newer version of pnpm. It is a compatible version but it might get downgraded to version 6.0
.pnpm                                    |  WARN  Your pnpm-lock.yaml was generated by a newer version of pnpm. It is a compatible version but it might get downgraded to version 6.0
 ERROR  /@aws-amplify/cli@9.1.0 is an invalid relative dependency path

How can I update my pnpm version without deleting the store?
Instead of deleting the store just remove the lock.yaml in ~/.local/share/pnpm/global/5/.pnpm and the pnpm-lock.yaml in ~/.local/share/pnpm/global/5

Please, please change the major version everytime something changes in the lock file in the future to avoid this breaking changes.

pnpm version:

8.6.1

Code to reproduce the issue:

pnpm i -g pnpm@8.6.1 
#install something globally like pnpm i -g @aws-amplify/cli or install deps in any workspace
pnpm i -g pnpm@8.5.1
pnpm i -g pnpm@8.6.1

Expected behavior:

It works.

Actual behavior:

It doesn't work and can't update pnpm.

Additional information:

  • node -v prints: v18.16.0
  • Windows, macOS, or Linux?: Linux (WSL)
@pitgrap pitgrap changed the title Cannot update update pnpm after downgrade Cannot update pnpm after downgrade Jun 9, 2023
@zkochan
Copy link
Member

zkochan commented Jun 11, 2023

It is caused by this issue: #6648

I will fix it. To fix the update issue you may either manually change the lockfile version to 6.0 in the global directory's lockfile. Or install pnpm using the standalone script: https://pnpm.io/installation#using-a-standalone-script

@zkochan
Copy link
Member

zkochan commented Jun 19, 2023

This won't be a problem anymore. I have deprecated the non-backward compatible versions of pnpm. But if it did happen to you, you can try what I suggested above. Or you can uninstall pnpm: https://pnpm.io/uninstall
and then install it again.

@zkochan zkochan closed this as completed Jun 19, 2023
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