-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
chore: specify pnpm version in package.json #1016
base: main
Are you sure you want to change the base?
Conversation
Problem = It's possible to use a different version of pnpm than the one that is used in CI. This can lead to inconsistencies between the local development environment and the CI environment. Solution = Specify the version of pnpm that is used in the `engines` field of `package.json`. This results in an error message similar to the following when a different version of pnpm is used: ```sh $ corepack prepare pnpm@latest --activate $ pnpm i ERR_PNPM_UNSUPPORTED_ENGINE Unsupported environment (bad pnpm and/or Node.js version) Your pnpm version is incompatible with "/Users/mikavilpas/git/openapi-ts". Expected version: 8.15.7 Got: 9.9.0 This is happening because the package's manifest has an engines.pnpm field specified. To fix this issue, install the required pnpm version globally. To install the latest version of pnpm, run "pnpm i -g pnpm". To check your pnpm version, run "pnpm -v". $ corepack prepare [email protected] --activate ```
Run & review this pull request in StackBlitz Codeflow. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Note that it may make sense to also upgrade the version in these places instead as there seem to be some errors .github/workflows/ci.yml|27 col 20| version: 8.15.7
.github/workflows/release.yml|26 col 20| version: 8.15.7
.github/workflows/coverage.yml|26 col 20| version: 8.15.7 |
I forgot to attach the docs. They can be found here https://pnpm.io/package_json |
pnpm-lock.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there changes in the lock file? Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be happening if my environment is somehow different... Are you using pnpm version 8.15.7 or something else?
I also get this extra output so maybe my environment is missing some step 🤔
Details
~/git/openapi-ts specify-pnpm-version $✘ v20.10.0 14:45
$ pnpm i
Scope: all 11 workspace projects
WARN 7 deprecated subdependencies found: @humanwhocodes/[email protected], @humanwhocodes/[email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Already up to date
Progress: resolved 1572, reused 1491, downloaded 0, added 0, done
. prepare$ husky
└─ Done in 238ms
.../openapi-ts-tanstack-svelte-query prepare$ svelte-kit sync
└─ Done in 667ms
WARN Issues with peer dependencies found
.
├─┬ @typescript-eslint/eslint-plugin 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/type-utils 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/utils 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
├─┬ eslint-plugin-typescript-sort-keys 3.2.0
│ ├── ✕ unmet peer eslint@"^7 || ^8": found 9.6.0
│ └─┬ @typescript-eslint/experimental-utils 5.62.0
│ ├── ✕ unmet peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0": found 9.6.0
│ └─┬ @typescript-eslint/utils 5.62.0
│ └── ✕ unmet peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0": found 9.6.0
├─┬ eslint-plugin-vue 9.23.0
│ └── ✕ unmet peer eslint@"^6.2.0 || ^7.0.0 || ^8.0.0": found 9.6.0
└─┬ typescript-eslint 7.15.0
├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
├─┬ @typescript-eslint/eslint-plugin 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
└─┬ @typescript-eslint/parser 7.15.0
└── ✕ unmet peer eslint@^8.56.0: found 9.6.0
examples/openapi-ts-axios
├─┬ @typescript-eslint/eslint-plugin 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/type-utils 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/utils 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
├─┬ @typescript-eslint/parser 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
└─┬ eslint-plugin-react-hooks 4.6.2
└── ✕ unmet peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0": found 9.6.0
examples/openapi-ts-fetch
├─┬ @typescript-eslint/eslint-plugin 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/type-utils 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/utils 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
├─┬ @typescript-eslint/parser 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
└─┬ eslint-plugin-react-hooks 4.6.2
└── ✕ unmet peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0": found 9.6.0
examples/openapi-ts-tanstack-react-query
├─┬ @typescript-eslint/eslint-plugin 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/type-utils 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/utils 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
├─┬ @typescript-eslint/parser 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
└─┬ eslint-plugin-react-hooks 4.6.2
└── ✕ unmet peer eslint@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0": found 9.6.0
examples/openapi-ts-tanstack-vue-query
└─┬ @vue/eslint-config-typescript 13.0.0
├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
├─┬ @typescript-eslint/eslint-plugin 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/type-utils 7.15.0
│ ├── ✕ unmet peer eslint@^8.56.0: found 9.6.0
│ └─┬ @typescript-eslint/utils 7.15.0
│ └── ✕ unmet peer eslint@^8.56.0: found 9.6.0
└─┬ @typescript-eslint/parser 7.15.0
└── ✕ unmet peer eslint@^8.56.0: found 9.6.0
packages/openapi-ts
├─┬ @angular-devkit/build-angular 17.3.7
│ ├── ✕ unmet peer typescript@">=5.2 <5.5": found 5.5.3
│ └─┬ @ngtools/webpack 17.3.7
│ └── ✕ unmet peer typescript@">=5.2 <5.5": found 5.5.3
└─┬ @angular/compiler-cli 17.3.9
└── ✕ unmet peer typescript@">=5.2 <5.5": found 5.5.3
Done in 3.8s
package.json
Outdated
@@ -31,7 +31,8 @@ | |||
"typecheck": "pnpm --recursive typecheck" | |||
}, | |||
"engines": { | |||
"node": "^18.0.0 || >=20.0.0" | |||
"node": "^18.0.0 || >=20.0.0", | |||
"pnpm": "8.15.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this should also be a range?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to >=8 <9
which should allow for some leeway.
Yeah we definitely want the build to pass. Here's the error message in case you can't see it
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1016 +/- ##
=======================================
Coverage 76.19% 76.19%
=======================================
Files 89 89
Lines 10973 10973
Branches 1113 1113
=======================================
Hits 8361 8361
Misses 2605 2605
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
commit: |
Following the instructions in https://vercel.com/docs/errors/error-list#pnpm-engine-unsupported It should fix the error: ```text Using package.json#engines.pnpm without corepack and package.json#packageManager could lead to failed builds with ERR_PNPM_UNSUPPORTED_ENGINE. Learn more: https://vercel.com/docs/errors/error-list#pnpm-engine-unsupported ERR_PNPM_UNSUPPORTED_ENGINE Unsupported environment (bad pnpm and/or Node.js version) ``` ```
Problem
It's possible to use a different version of pnpm than the one that is used in CI. This can lead to inconsistencies between the local development environment and the CI environment.
Solution
Specify the version of pnpm that is used in the
engines
field ofpackage.json
.This results in an error message similar to the following when a different version of pnpm is used: