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
With ignore-scripts=true in ~/.npmrc OR ./.npmrc - the following behavior is observed:
$ npm approve-scripts --allow-scripts-pending
No packages with unreviewed install scripts.
no scripts can be identified or added to allowlist
$ npm ci --foreground-scripts
no scripts run even with "allowScripts" correctly specifieed in package.json
Expected Behavior
npm approve-scripts Should list scripts pending for approval, thus enabling migration from the configuration where scritps were ignored to a configuration with an allowlist.
Should manage and execute the allowlist even if ignore-scripts=true is still set (to avoid falling back to running all scripts when npm is accidentally downgraded)
Caution
Being able to keep ignore-scripts=true in .npmrc while using the allowlist is the only way to avoid defaulting to running all install scripts whenever use of Node.js version managers or system path tweaks or adding new team members causes someone to run an older version of npm
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
With
ignore-scripts=truein ~/.npmrc OR ./.npmrc - the following behavior is observed:"allowScripts"correctly specifieed inpackage.jsonExpected Behavior
npm approve-scriptsShould list scripts pending for approval, thus enabling migration from the configuration where scritps were ignored to a configuration with an allowlist.Should manage and execute the allowlist even if
ignore-scripts=trueis still set (to avoid falling back to running all scripts when npm is accidentally downgraded)Caution
Being able to keep
ignore-scripts=truein.npmrcwhile using the allowlist is the only way to avoid defaulting to running all install scripts whenever use of Node.js version managers or system path tweaks or adding new team members causes someone to run an older version ofnpmSteps To Reproduce
package.json
{ "name": "test", "version": "1.0.0", "description": "", "main": "index.js", "keywords": [], "author": "", "license": "ISC", "dependencies": { "not-really-a-package": "^1.1.0" }, "devDependencies": { "@lavamoat/preinstall-always-fail": "^1.0.3" } }~/.npmrc OR ./.npmrc
Environment
$ npm --version
11.16.0