You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feature request] Use version of pnpm specified in package.json's engines section #84
In my projects, I'm trying to specify exact versions of dependencies (including node and pnpm).
I would like to specify a version of pnpm once in package.json and reuse in pnpm/action-setup action
package.json has engines section for this
{
"engines": {
"pnpm": "7.32.5"
},
}
Would be great, if pnpm/action-setup could support this field.
Note: actions/setup-node supports engines.node via node-version-file property.
I'm also aware of packageManager property of package.json, but with it – I can't enforce exact version of PNPM, however with engines.pnpm + engine-strict=true - I can, so everyone in the team has same environment
Reacted by Oscar Blanco, Jake Goulding, Viktor Andersson, Karl Horky, Artem Sapegin, Ben McCann, RJ Dellecese, Oleksandr Hrishchuk, Etai Peretz, Tom Le Feuvre and 5 more
I'm also aware of packageManager property of package.json, but with it – I can't enforce exact version of PNPM, however with engines.pnpm + engine-strict=true - I can, so everyone in the team has same environment
You can specify both packageManager and devEngines fields in package.json:
Hi @jrmajor , thanks for your reply. This is a good solution, although I think it's not optimal and doesn't solve the original issue. It requires mental effort to keep version of PNPM in sync between packageManager and engines/devEngines sections.(almost the same as syncing it between actions/setup-node setup and package.jsonengines I have now).
I would like to have just 1 source of truth for PNPM version management. This way, updating 1 place is easy and less error-prone.
Reacted by Bo Lingen, Clement Arnaud and Brody McKee
Activity
kopach commentedon Jun 5, 2023
For anyone interested, as a workaround, I'm doing this right now
Manually read pnpm version from package.json
jrmajor commentedon Jul 23, 2025
You can specify both
packageManageranddevEnginesfields inpackage.json:I think this covers all cases where you may want to enforce usage of specific version of pnpm:
pnpm/action-setupwill automatically respect version frompackageManager,npm install, it fails because ofdevEngines(feat: devEngines npm/cli#7766)yarn install, it fails because ofpackageManager(Hotfixes for the 1.22.20 yarnpkg/yarn#9009),packageManager(feat: automatically switch to the right pnpm version pnpm#8363 and pnpm/pnpm@dfcf034).Would that solve your issue, or are there more reasons why
engines.pnpmsupport would be needed?kopach commentedon Aug 15, 2025
Hi @jrmajor , thanks for your reply. This is a good solution, although I think it's not optimal and doesn't solve the original issue. It requires mental effort to keep version of PNPM in sync between
packageManagerandengines/devEnginessections.(almost the same as syncing it betweenactions/setup-nodesetup andpackage.jsonenginesI have now).I would like to have just 1 source of truth for PNPM version management. This way, updating 1 place is easy and less error-prone.