docs(install): npm 12 blocks openclaw install scripts by default (#115224)

The documented `npm install -g openclaw@latest` does not run OpenClaw's
preinstall/postinstall steps on npm 12, which blocks package lifecycle
scripts by default. Nothing in the install docs mentioned this.

Adds a note to the npm tab with the working command. The pnpm tab
already documents its equivalent (`pnpm approve-builds -g`), so npm was
the only tab without one.

Scoped to npm 12 rather than 11.16: `strict-allow-scripts` is undefined
on npm 11.12.1 and false on both 11.16.0 and 12.0.1, and only npm 12
reports the scripts as "blocked because they are not covered by
allowScripts". npm 11.16.x warns that they are "not yet covered" and
still runs them, so the note describes it as warning-only and keeps the
ENOMATCH caveat about the approve-scripts remedy it suggests.

Closes #114665

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Zakaria Rahali
2026-07-29 08:53:35 +01:00
committed by GitHub
parent b2cc5f5042
commit 014ec7d50a
+17
View File
@@ -80,6 +80,23 @@ If you already manage Node yourself:
openclaw onboard --install-daemon
```
<Note>
npm 12 blocks package lifecycle scripts by default, so the command above
skips OpenClaw's `preinstall` and `postinstall` steps — npm reports them
as `blocked because they are not covered by allowScripts`. Allow them
explicitly:
```bash
npm install -g openclaw@latest --allow-scripts openclaw
```
npm 11.16.x only warns that the scripts are `not yet covered by
allowScripts` and still runs them. If you want to clear that warning, be
aware that the `npm approve-scripts openclaw` command it suggests does not
work for a global install — it fails with `ENOMATCH No installed packages
match: openclaw`. npm 11.12 and earlier have no such policy.
</Note>
<Note>
The hosted installer clears npm freshness filters such as `min-release-age`
for the OpenClaw package install. If you install manually with npm, your own