timothymiller / t4-app

A powerful cross-platform UI toolkit for building actually native iOS, Android, macOS, Windows, Linux, and Progressive Web Apps with React (Native).
https://t4stack.com
MIT License
1.34k stars 71 forks source link

Omitting the patch version in engines in the package.json file #34

Closed Desttro closed 1 year ago

Desttro commented 1 year ago

Since pnpm versions are changing rapidly and it happens that the version in GitHub actions is not always up to date, it is better to define only major and minor versions.

I have set it for both engines, node and pnpm.

Extract from the workflow log:

Run pnpm install --frozen-lockfile --prefer-offline
ERR_PNPM_UNSUPPORTED_ENGINE Unsupported environment (bad pnpm and/or Node.js version)

Your pnpm version is incompatible with "/home/runner/work/t4-app/t4-app".

Expected version: >=8.6.9
Got: 8.6.5

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".
Error: Process completed with exit code 1.
Desttro commented 1 year ago

As far as packageManager is concerned, the versions must be in major, minor, and patch. But that shouldn't affect this issue (it's for Corepack). I also set it to 8.6.0 just to be safe.

Desttro commented 1 year ago

Workflow respects the packageManager version, so I'm reverting, but for engines major and minor versions are sufficient to solve the problem.