GeezerVison is showing github.com — Support `devEngines` field in `package.json` · Issue #1255 · actions/setup-node
Support devEngines field in package.json #1255Description
Description:
devEngines field is now supported by npm and corepack.
If user set node-version-file: package.json in yaml, setup-node action should consult both engines and devEngines fields, while currently only engines works.
Justification:
In monorepo, the root package.json usually have no engines field. Moreover, the engines is for users who install the npm package, while the devEngines field is for who developers who develop the npm package. Obviously, devEngines is more suitable for setup-node.
Are you willing to submit a PR?
Yes Reacted by Juan Sanchez, Ferdinand Thiessen, Marian Klühspies, Tim Chen, Sebastian Davids, Grigory, sasaplus1, Bo Lingen, Yuhei Yasuda, Taiga KATARAO and 10 more Reacted by Nozomi Ishii Activitysuyashgaonkar commented on Mar 24, 2025 Hi @zanminkian , Thank you for creating this feature request. We will investigate it and provide feedback as soon as we have some updates. mklueh commented on Apr 13, 2025 And if anyone is working on this, maybe you could also consider factoring in the volta node field?
Then you could run volta pin [email protected] which would fetch and install node, set the node version in package.json volta.node and that's all you have to do
https://docs.volta.sh/reference/pin
But maybe it would be better to let volta handle the devEngines update instead of making this action volta-aware Reacted by fregante, Jesús Leganés-Combarro, zanminkian, Noah S-C, Ryan Suhartanto and Julien Roncaglia susnux commented on Apr 20, 2025 zanminkian commented on Jul 30, 2025 @mklueh volta is not the standard, but devEngines is the standard which is supported by npm, pnpm, corepack ...
BTW I don't consider volta until it stablely supports pnpm. zanminkian commented on Dec 19, 2025 Here is a workaround to support devEngines:
- uses: actions/checkout@v4
# TODO: Remove this step when https://github.com/actions/setup-node/pull/1283 is merged
- name: Get Node.js version
id: get-node-version
run: |
node_version=$(jq -r '.devEngines.runtime.version // empty' package.json)
if [ -z "$node_version" ]; then
echo "Error: No Node.js version specified in devEngines.runtime.version"
exit 1
fi
echo "node-version=$node_version" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v4
with:
node-version: ${{ steps.get-node-version.outputs.node-version }}Reacted by Kutsan Kaplan, Julien Roncaglia, Peter Abrahamsen and Minsu Lee v-aparnajyothi-y commented on Jan 28, 2026 Hello Everyone, Thanks for the detailed feedback and examples shared here. Based on the discussion and internal review, we agree this would be a useful enhancement with minimal impact on existing workflows.
We’re planning to extend node-version-file: package.json to also consider devEngines, with the following precedence:
volta.node → devEngines.runtime → engines.node
This keeps the current behavior unchanged unless devEngines (or volta) is explicitly defined, while better supporting developer-focused and monorepo setups. We’ll ensure the precedence is clearly documented and will share updates as the implementation progresses.
Please feel free to reach if you have any questions or concerns regarding this change. Reacted by Kutsan Kaplan and Takuya Fukuju Reacted by Eli, Kutsan Kaplan, Peter Abrahamsen, Callum Watkins and Nozomi Ishii
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|