File Explorer

/var/lang/lib/node_modules/npm/docs/content/commands

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

npm-deny-scripts.md2.8 KB · 111 lines
---title: npm-deny-scriptssection: 1description: Deny install scripts for specific dependencies--- ### Synopsis ```bashnpm deny-scripts <pkg> [<pkg> ...]npm deny-scripts --all``` Note: This command is unaware of workspaces. ### Description The companion command to [`npm approve-scripts`](/commands/npm-approve-scripts).Writes `false` entries into the `allowScripts` field of your project's`package.json`, recording that a dependency must not run install scriptseven if a future version would otherwise be eligible. In the current release, install scripts still run by default, so `deny-scripts`only affects how installs of denied packages are reported. A future releasewill block unreviewed install scripts and respect deny entries at installtime. ```bashnpm deny-scripts <pkg> [<pkg> ...]npm deny-scripts --all``` `<pkg>` matches every installed version of that package. Denies are alwayswritten name-only (`"pkg": false`), regardless of `--allow-scripts-pin`. Pinning a denyto a specific version would silently re-allow scripts for any other versionof the same package, which defeats the purpose; the command picks thesafer default for you. `--all` denies every package with unreviewed install scripts. If a `true` (pinned or name-only) entry exists for a package and you thendeny it, the existing allow entries are removed so the name-only deny isunambiguous. ### Examples ```bash# Deny a specific package outrightnpm deny-scripts telemetry-pkg # Deny everything that has install scripts and isn't already approvednpm deny-scripts --all``` ### Configuration #### `all` * Default: false* Type: Boolean Show or act on all packages, not just the ones your project directly dependson. For `npm outdated` and `npm ls` this lists every outdated or installedpackage. For `npm approve-scripts` and `npm deny-scripts` it selects everypackage with pending install scripts.   #### `allow-scripts-pending` * Default: false* Type: Boolean List packages with install scripts that are not yet covered by the`allowScripts` policy, without modifying `package.json`. Only meaningful for`npm approve-scripts`.   #### `allow-scripts-pin` * Default: true* Type: Boolean Write pinned (`pkg@version`) entries when approving install scripts. Set to`false` to write name-only entries that allow any version. Has no effect on`npm deny-scripts`, which always writes name-only entries regardless of thissetting.   #### `json` * Default: false* Type: Boolean Whether or not to output JSON data, rather than the normal output. * In `npm pkg set` it enables parsing set values with JSON.parse() before  saving them to your `package.json`. Not supported by all npm commands.   ### See Also * [npm approve-scripts](/commands/npm-approve-scripts)* [npm install](/commands/npm-install)* [package.json](/configuring-npm/package-json)