Repository navigation
Description
npm 12 blocks pnpm's install scripts, so Turbo jobs fail with Exec format error
Summary
After the runner image picked up npm 12 (via npm install -g npm@latest in Dockerfile:68), every
Turbo-based job fails before tests start:
$ pnpm run self:clean && turbo run clean
##[error]command finished with error: Exec format error (os error 8)
@blendsdk/webafx-i18n#clean: ERROR command finished with error: Exec format error (os error 8)
...
Tasks: 0 successful, 21 total
npm 12 blocks dependency lifecycle scripts by default unless the package is covered by
allowScripts. pnpm's preinstall/postinstall (node install.js) is what replaces pnpm's
shebang-less wrapper with the platform-native binary. Because the script is blocked, the
placeholder stays in place; shells can still run it, but Turbo spawns the resolved pnpm binary
directly and gets ENOEXEC.
Impact
- Any job that runs Turbo (
turbo run ...) afternpm install -g pnpm@<version>fails
immediately, before build or tests. Observed inTrueSoftwareNL/blendsdk(run
37159998714, 2026-10-06). - Jobs that only call
pnpmthrough a shell (pnpm install,pnpm run ...) still pass, which
makes the failure look like a Turbo problem rather than an npm/pnpm packaging problem. - Affects every organization whose repositories use Turbo plus a global pnpm install. The
blendsdkrepo is the known case; others may be affected after the next image rebuild.
Environment
| Item | Value |
|---|---|
| Runner image | built from this repository (Dockerfile) |
| Base | Ubuntu 24.04 |
| Runner | actions/runner 2.337.0 |
| Node | installed at build via nvm install --lts (Dockerfile:65-68) and re-checked at every container start (start.sh:50) |
| npm | npm 12 (installed via npm install -g npm@latest, Dockerfile:68) |
| pnpm | any version installed with npm install -g pnpm@..., e.g. 12.8.1 |
Symptoms
-
During
Install dependencies, the job logs:npm warn install-scripts 1 package had install scripts blocked because they are not covered by allowScripts: npm warn install-scripts pnpm@12.8.1 (preinstall: node install.js; postinstall: node install.js) npm warn install-scripts Run `npm install -g --allow-scripts=pnpm` to allow these scripts once, or `npm config set allow-scripts=pnpm --location=user` to allow them for all global installs.The previous runner (npm 11) only warned and still ended up with a working native binary:
npm warn allow-scripts 1 package has install scripts not yet covered by allowScripts: npm warn allow-scripts pnpm@12.8.1 (preinstall: node install.js; postinstall: node install.js) -
Turbo then fails every task:
$ pnpm run self:clean && turbo run clean $ rm -rf .turbo • Packages in scope: ... • Running clean in 22 packages ##[error]command finished with error: Exec format error (os error 8) ... ##[error]unable to spawn child process: Exec format error (os error 8) ... Tasks: 0 successful, 21 total
Root cause
- npm 12 blocks dependency lifecycle scripts by default unless covered by
allowScripts
(npm/cli PR #9838; change introduced in commit
5cd5150,
released as an npm 12 breaking change). This image installsnpm@latest, so rebuilds after the
npm 12 release started shipping npm 12. - The
pnpmnpm package ships itspnpmentry point as a shebang-less placeholder (ansh
script is not required; it is designed to fall back tobin/pnpm.mjsvia Node). The package's
install.jsreplaces that placeholder with the host's native binary; npm 12 blocks that script,
so the placeholder remains. - Why shell calls still work: POSIX shells handle
ENOEXECby retrying the file throughsh, so
pnpm install,pnpm build, and other workflow steps succeed. - Why Turbo fails: Turbo 2.10 runs each package script by resolving the package-manager binary and
executing it directly (crates/turborepo-task-executor/src/command.rs,Command::new(spec.program)
viapackage_manager_binary()), with no shell fallback. The placeholder is not a valid
executable, so every spawn fails withExec format error (os error 8).
Relevant files in this repository:
| File | Relevance |
|---|---|
Dockerfile:46-50 |
copies host .npmrc to /home/docker/.npmrc |
Dockerfile:61-68 |
USER docker; nvm install --lts; npm install -g npm@latest yarn pnpm |
start.sh:50 |
nvm install --lts on every container start (refreshes the runtime npm) |
entrypoint.sh:109-110 |
runs the runner as user docker with HOME=/home/docker |
test/dockerfile.spec.test.sh:39-40 |
existing static checks for globally installed package managers |
Reproduction
With a staged build context (the image build needs the host credential files):
docker build -t build-server:test .
docker run --rm --privileged build-server:test bash -lc '
npm --version # expect 12.x
npm install -g pnpm@12.8.1
file "$(readlink -f "$(which pnpm)")" # currently: ASCII text (placeholder)
'The second command prints the install-scripts ... blocked warning, and file reports a text
placeholder instead of an ELF binary.
Recommended fix
Allowlist only pnpm's lifecycle script; do not blanket-enable all dependency scripts. Any one of
these is sufficient (Option A or B preferred; both keep the npm 12 supply-chain protection and
apply to every job in the container):
| Option | Change | Notes |
|---|---|---|
| A (recommended) | Add ENV NPM_CONFIG_ALLOW_SCRIPTS=pnpm to Dockerfile, next to ENV NVM_DIR=/home/docker/.nvm (Dockerfile:64) |
One line; applies to the image build and every job step; environment config outranks the user .npmrc; no file ownership concerns when nvm install --lts switches Node versions at runtime |
| B | Append allow-scripts=pnpm to the staged /home/docker/.npmrc and make sure the runner user can read it (for example chown docker:docker /home/docker/.npmrc) |
Matches npm's own npm config set allow-scripts=pnpm --location=user recommendation; verify the staged file's mode, since the runner runs as docker |
| C (workaround, not in this repo) | Pass --allow-scripts=pnpm to npm install -g pnpm@... in each dependent workflow |
Requires touching every workflow and does not fix other repositories |
Also check whether the globally installed yarn (Dockerfile:68) needs the same treatment for the
organizations that use it. That is a separate decision and is not required for the reported failure.
Acceptance criteria
- After rebuilding the image and restarting a runner container:
npm config get allow-scriptsreturnspnpm, orNPM_CONFIG_ALLOW_SCRIPTS=pnpmis present in
the runner environment (check withprintenv NPM_CONFIG_ALLOW_SCRIPTS).npm install -g pnpm@12.8.1emits noinstall-scripts ... blockedwarning.file "$(readlink -f "$(which pnpm)")"reports an ELF 64-bit executable.- A Turbo job succeeds at
pnpm clean && pnpm build(turbo run cleancompletes without
Exec format error).
- Recommended, matching the repository's spec-first convention: extend
test/dockerfile.spec.test.shwith an assertion that the image allows pnpm's install scripts
(for example,grep -Eq 'NPM_CONFIG_ALLOW_SCRIPTS=pnpm|allow-scripts=pnpm' "${DOCKERFILE}"). - Run
bash test/verify.shbefore opening the change.
References
- npm/cli PR #9838 "docs: document npm 12 install script blocking" and commit
5cd5150. - npm package
pnpm@12.8.1:package.json(preinstall/postinstall: node install.js),
install.js, and the shebang-lesspnpmplaceholder. - Turborepo 2.10.8:
crates/turborepo-task-executor/src/command.rs(direct package-manager spawn). - Failed downstream run:
TrueSoftwareNL/blendsdkactions run 37159998714 (2026-10-06).
Activity