allowScripts field in its package.json. It tells npm which
dependencies may run an install script. This page explains why it’s there, what the kit ships with,
and what to do when you add a dependency that has a script.
Why the field exists
Recent npm (11.19 and later — bundled with current Node 24 releases and thenode:24-* Docker images)
no longer runs dependencies’ install scripts by default: preinstall, install, postinstall,
prepare for file: / git dependencies, and the implicit node-gyp rebuild for packages that ship a
binding.gyp. A script runs only if the project’s allowScripts allows that package. Your project’s
own scripts still run as usual.
An install script is code that runs on npm install with your user’s rights — your SSH keys, .env
files and CI tokens included. Hijacked packages have abused exactly that, which is why npm now asks you
to opt in package by package. Older npm versions ignore the field and run every script, so it’s safe
whatever npm your machine or CI uses.
The install never fails because of it. It finishes and then lists what it skipped:
npm warn install-scripts … not yet covered by allowScripts.
What the kit ships with
Every dependency script in the kit is denied, because none is needed:
A fresh
npm install of each repo therefore finishes with no warning. The repos don’t commit
package-lock.json (it’s in .gitignore), so every install resolves versions anew; the denials name
the package, not a version, and so keep holding as versions move.
When you add a dependency with a script
If an install ends with “not yet covered by allowScripts”:npm install-scripts ls— see which packages are undecided.- Look at what the script does:
npm view <pkg>@<version> scripts, ornode_modules/<pkg>/package.jsonand the files it runs. - Record a decision:
- The package needs its script (it downloads or compiles something it can’t work without —
sharp, which@capacitor/assetsuses for icon generation, is the classic example):npm install-scripts approve <pkg>, thennpm rebuild <pkg>. The approval is pinned to the version you reviewed ("sharp@x.y.z": true). - It doesn’t (it only checks, optimises or prints something):
npm install-scripts deny <pkg>.
- The package needs its script (it downloads or compiles something it can’t work without —
- Commit
package.jsonso everyone — and your CI and Docker builds — gets the same decision.
npm install-scripts approve <pkg> again (the pin moves to the new version) and
npm rebuild <pkg>.
npm install-scripts prune removes entries for packages that are no longer installed.
A package that isn’t installed on your machine (for example fsevents on Linux) can’t be denied
with the command — it answers ENOMATCH. Add "<pkg>": false to allowScripts by hand; that is what
the command would write.
A native module fails after a fresh install (Could not load the … module, a missing .node
file): its script was needed. Approve it and npm rebuild it.
Don’t silence the warning with npm install-scripts approve --all or
--dangerously-allow-all-scripts — both switch the protection off.
Docker, servers and CI
- The Dockerfiles copy
package*.jsonand runnpm install. Without a committed lockfile that ispackage.jsonalone, so each image build resolves dependencies afresh and applies the sameallowScripts. Currentnode:24-*images enforce it; an older base image ignores it and runs everything, which also works. - Nothing in the backend or admin image needs a dependency script.
- Watch build logs for
npm warn install-scripts: a fresh resolve pulled in a package with a script that has no decision yet. Decide it (above), commitpackage.json, rebuild. - npm only warns about packages it actually installed on that machine. To see every platform’s
packages, resolve
package.jsonin an empty directory and look for"hasInstallScript": truein thepackage-lock.jsonit writes. - To make an undecided script fail the install instead of warning — useful in CI — set
strict-allow-scripts=truein the repo’s.npmrc, or pass--strict-allow-scriptsto the install. Explicit denials are never affected.