You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
namespace the install-script approval commands #9545
Follow-up from RFC #868 (make install scripts opt-in), tracking the command-naming discussion at npm/rfcs#868 (comment).
Background
npm v11.16.0 shipped two top-level commands, npm approve-scripts and npm deny-scripts. Both are thin subclasses of lib/utils/allow-scripts-cmd.js, registered in lib/utils/cmd-list.js. The verb-noun shape came from pnpm (pnpm approve-builds), and it doesn't match how npm normally groups related operations: npm cache <cmd>, npm team <cmd>, npm token <cmd>, npm org <cmd>.
Proposal
Add one namespaced command and keep the verb-noun forms as aliases (they've shipped, so this stays backwards compatible):
npm install-scripts approve <pkg>... | --all
npm install-scripts deny <pkg>...
npm install-scripts ls (list unreviewed; see companion issue)
npm approve-scripts / npm deny-scripts alias to the above
Thinking more about the naming, I wonder whether npm scripts is still the best name for this. The reason is that npm install-scripts reads imperative, just like allow-remote, allow-scripts, npm install, etc., the correct noun based name should ideally be npm installation-scripts, but that doesn't sound exciting. 😄
npm scripts approve and npm scripts deny read better and, IMHO, represent what they actually deal with - "scripts (from dependencies)", just like --ignore-scripts (for all lifecycle scripts).
Otherwise, we could be even more explicit about what it means
Activity
manzoorwanijk commentedon Jun 13, 2026
Thinking more about the naming, I wonder whether
npm scriptsis still the best name for this. The reason is thatnpm install-scriptsreads imperative, just likeallow-remote,allow-scripts,npm install,etc., the correct noun based name should ideally benpm installation-scripts, but that doesn't sound exciting. 😄npm scripts approveandnpm scripts denyread better and, IMHO, represent what they actually deal with - "scripts (from dependencies)", just like--ignore-scripts(for all lifecycle scripts).Otherwise, we could be even more explicit about what it means
npm package-scripts allow/denynpm dependency-scripts approve/denyThat said,
npm scriptsis short and clear.manzoorwanijk commentedon Jun 19, 2026
I want to work on this. Can we please settle the naming?
CC: @owlstronaut
JamieMagee commentedon Jun 23, 2026
Let's go with
install-scripts. We think there is too much overlap withscriptsinpackage.jsonto use it asnpm scripts.ljharb commentedon Jun 23, 2026
That name also properly conveys that it's only install scripts, and not other lifecycle scripts, that are affected.
manzoorwanijk commentedon Jun 24, 2026
Created #9629
feat: namespace install-script approval commands under npm install-sc…
feat: namespace install-script approval commands under npm install-sc…
feat: namespace install-script approval commands under npm install-sc…
feat: namespace install-script approval commands under npm install-sc…
manzoorwanijk commentedon Jun 29, 2026
@JamieMagee @owlstronaut should we change that
npm warn allow-scriptstonpm warn install-scriptsas well?manzoorwanijk commentedon Jun 29, 2026
OK, I have created #9697 to update it.