Minimal reproduction for actions/setup-node#1553:
with caching enabled, setup-node runs npm config get cache in the workspace root. npm aborts that
command with EBADDEVENGINES when the root package.json declares a devEngines.packageManager that
the installed npm doesn't satisfy, so setup-node fails before any later step can install the required
package manager.
Each workflow copies one scenario to the workspace root, sets engines.node to the matrix Node major,
and runs setup-node with cache: npm.
| Scenario | Root package.json |
node-version-file |
cache-dependency-path |
|---|---|---|---|
single-npm |
devEngines npm ^11.10.0 |
package.json |
package-lock.json |
monorepo-pnpm-root |
devEngines pnpm ^10.0.0 |
app/package.json (plain npm project) |
app/package-lock.json |
npm12-required |
devEngines npm >=12.2.2 (onFail: error) |
package.json |
package-lock.json |
plain |
no devEngines (regression control) |
package.json |
package-lock.json |
repro.yml(manual): the original reproduction againstactions/setup-node@v7.0.0on Node 22 and 24, including a check ofnpm config get cache --force.fix.yml: before/after. Every scenario runs on Node 22, 24 and 26 with upstreamactions/setup-node@v7.1.0and with the proposed fix (eran132/setup-node@fix/npm-cache-devengines), 10 attempts each. Jobs using the fix have nocontinue-on-error, so the post-job cache save has to pass as well.
See the Actions tab for results.