/var/lang/lib/node_modules/npm/man/man1
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 /.
.TH "NPM-AUDIT" "1" "February 2026" "NPM@11.11.0" "".SH "NAME"\fBnpm-audit\fR - Run a security audit.SS "Synopsis".P.RS 2.nfnpm audit \[lB]fix|signatures\[rB].fi.RE.SS "Description".PThe audit command submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities. If any vulnerabilities are found, then the impact and appropriate remediation will be calculated. If the \fBfix\fR argument is provided, then remediations will be applied to the package tree..PThe command will exit with a 0 exit code if no vulnerabilities were found..PNote that some vulnerabilities cannot be fixed automatically and will require manual intervention or review. Also note that since \fBnpm audit fix\fR runs a full-fledged \fBnpm install\fR under the hood, all configs that apply to the installer will also apply to \fBnpm install\fR -- so things like \fBnpm audit fix --package-lock-only\fR will work as expected..PBy default, the audit command will exit with a non-zero code if any vulnerability is found. It may be useful in CI environments to include the \fB--audit-level\fR parameter to specify the minimum vulnerability level that will cause the command to fail. This option does not filter the report output, it simply changes the command's failure threshold..SS "Package lock".PBy default npm requires a package-lock or shrinkwrap in order to run the audit. You can bypass the package lock with \fB--no-package-lock\fR but be aware the results may be different with every run, since npm will re-build the dependency tree each time..SS "Audit Signatures".PTo ensure the integrity of packages you download from the public npm registry, or any registry that supports signatures, you can verify the registry signatures of downloaded packages using the npm CLI..PRegistry signatures can be verified using the following \fBaudit\fR command:.P.RS 2.nf$ npm audit signatures.fi.RE.PThe \fBaudit signatures\fR command will also verify the provenance attestations of downloaded packages. Because provenance attestations are such a new feature, security features may be added to (or changed in) the attestation format over time. To ensure that you're always able to verify attestation signatures check that you're running the latest version of the npm CLI. Please note this often means updating npm beyond the version that ships with Node.js..PThe npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed:.RS 0.IP 1. 4Signatures are provided in the package's \fBpackument\fR in each published version within the \fBdist\fR object:.RE 0 .P.RS 2.nf"dist":{ "..omitted..": "..omitted..", "signatures": \[lB]{ "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}", "sig": "a312b9c3cb4a1b693e8ebac5ee1ca9cc01f2661c14391917dcb111517f72370809..." }\[rB]}.fi.RE.PSee this \fBexample\fR \fI\(lahttps://registry.npmjs.org/light-cycle/1.4.3\(ra\fR of a signed package from the public npm registry..PThe \fBsig\fR is generated using the following template: \fB${package.name}@${package.version}:${package.dist.integrity}\fR and the \fBkeyid\fR has to match one of the public signing keys below..RS 0.IP 2. 4Public signing keys are provided at \fBregistry-host.tld/-/npm/v1/keys\fR in the following format:.RE 0 .P.RS 2.nf{ "keys": \[lB]{ "expires": null, "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}", "keytype": "ecdsa-sha2-nistp256", "scheme": "ecdsa-sha2-nistp256", "key": "{{B64_PUBLIC_KEY}}" }\[rB]}.fi.RE.PKeys response:.RS 0.IP \(bu 4\fBexpires\fR: null or a simplified extended \fBISO 8601 format\fR \fI\(lahttps://en.wikipedia.org/wiki/ISO_8601\(ra\fR: \fBYYYY-MM-DDTHH:mm:ss.sssZ\fR.IP \(bu 4\fBkeyid\fR: sha256 fingerprint of the public key.IP \(bu 4\fBkeytype\fR: only \fBecdsa-sha2-nistp256\fR is currently supported by the npm CLI.IP \(bu 4\fBscheme\fR: only \fBecdsa-sha2-nistp256\fR is currently supported by the npm CLI.IP \(bu 4\fBkey\fR: base64 encoded public key.RE 0 .PSee this \fBexample key's response from the public npm registry\fR \fI\(lahttps://registry.npmjs.org/-/npm/v1/keys\(ra\fR..SS "Audit Endpoints".PThere are two audit endpoints that npm may use to fetch vulnerability information: the \fBBulk Advisory\fR endpoint and the \fBQuick Audit\fR endpoint..SS "Bulk Advisory Endpoint".PAs of version 7, npm uses the much faster \fBBulk Advisory\fR endpoint to optimize the speed of calculating audit results..Pnpm will generate a JSON payload with the name and list of versions of each package in the tree, and POST it to the default configured registry at the path \fB/-/npm/v1/security/advisories/bulk\fR..PAny packages in the tree that do not have a \fBversion\fR field in their package.json file will be ignored. If any \fB--omit\fR options are specified (either via the \fB\[rs]fB--omit\[rs]fR config\fR \fI\(la/using-npm/config#omit\(ra\fR, or one of the shorthands such as \fB--production\fR, \fB--only=dev\fR, and so on), then packages will be omitted from the submitted payload as appropriate..PIf the registry responds with an error, or with an invalid response, then npm will attempt to load advisory data from the \fBQuick Audit\fR endpoint..PThe expected result will contain a set of advisory objects for each dependency that matches the advisory range. Each advisory object contains a \fBname\fR, \fBurl\fR, \fBid\fR, \fBseverity\fR, \fBvulnerable_versions\fR, and \fBtitle\fR..Pnpm then uses these advisory objects to calculate vulnerabilities and meta-vulnerabilities of the dependencies within the tree..SS "Quick Audit Endpoint".PIf the \fBBulk Advisory\fR endpoint returns an error, or invalid data, npm will attempt to load advisory data from the \fBQuick Audit\fR endpoint, which is considerably slower in most cases..PThe full package tree as found in \fBpackage-lock.json\fR is submitted, along with the following pieces of additional metadata:.RS 0.IP \(bu 4\fBnpm_version\fR.IP \(bu 4\fBnode_version\fR.IP \(bu 4\fBplatform\fR.IP \(bu 4\fBarch\fR.IP \(bu 4\fBnode_env\fR.RE 0 .PAll packages in the tree are submitted to the Quick Audit endpoint. Omitted dependency types are skipped when generating the report..SS "Scrubbing".POut of an abundance of caution, npm versions 5 and 6 would "scrub" any packages from the submitted report if their name contained a \fB/\fR character, so as to avoid leaking the names of potentially private packages or git URLs..PHowever, in practice, this resulted in audits often failing to properly detect meta-vulnerabilities, because the tree would appear to be invalid due to missing dependencies, and prevented the detection of vulnerabilities in package trees that used git dependencies or private modules..PThis scrubbing has been removed from npm as of version 7..SS "Calculating Meta-Vulnerabilities and Remediations".Pnpm uses the \fB\[rs]fB@npmcli/metavuln-calculator\[rs]fR\fR \fI\(lahttp://npm.im/@npmcli/metavuln-calculator\(ra\fR module to turn a set of security advisories into a set of "vulnerability" objects. A "meta-vulnerability" is a dependency that is vulnerable by virtue of dependence on vulnerable versions of a vulnerable package..PFor example, if the package \fBfoo\fR is vulnerable in the range \fB>=1.0.2 <2.0.0\fR, and the package \fBbar\fR depends on \fBfoo@^1.1.0\fR, then that version of \fBbar\fR can only be installed by installing a vulnerable version of \fBfoo\fR. In this case, \fBbar\fR is a "metavulnerability"..POnce metavulnerabilities for a given package are calculated, they are cached in the \fB~/.npm\fR folder and only re-evaluated if the advisory range changes, or a new version of the package is published (in which case, the new version is checked for metavulnerable status as well)..PIf the chain of metavulnerabilities extends all the way to the root project, and it cannot be updated without changing its dependency ranges, then \fBnpm audit fix\fR will require the \fB--force\fR option to apply the remediation. If remediations do not require changes to the dependency ranges, then all vulnerable packages will be updated to a version that does not have an advisory or metavulnerability posted against it..SS "Exit Code".PThe \fBnpm audit\fR command will exit with a 0 exit code if no vulnerabilities were found. The \fBnpm audit fix\fR command will exit with 0 exit code if no vulnerabilities are found \fIor\fR if the remediation is able to successfully fix all vulnerabilities..PIf vulnerabilities were found the exit code will depend on the \fB\[rs]fBaudit-level\[rs]fR config\fR \fI\(la/using-npm/config#audit-level\(ra\fR..SS "Examples".PScan your project for vulnerabilities and automatically install any compatible updates to vulnerable dependencies:.P.RS 2.nf$ npm audit fix.fi.RE.PRun \fBaudit fix\fR without modifying \fBnode_modules\fR, but still updating the pkglock:.P.RS 2.nf$ npm audit fix --package-lock-only.fi.RE.PSkip updating \fBdevDependencies\fR:.P.RS 2.nf$ npm audit fix --only=prod.fi.RE.PHave \fBaudit fix\fR install SemVer-major updates to toplevel dependencies, not just SemVer-compatible ones:.P.RS 2.nf$ npm audit fix --force.fi.RE.PDo a dry run to get an idea of what \fBaudit fix\fR will do, and \fIalso\fR output install information in JSON format:.P.RS 2.nf$ npm audit fix --dry-run --json.fi.RE.PScan your project for vulnerabilities and just show the details, without fixing anything:.P.RS 2.nf$ npm audit.fi.RE.PGet the detailed audit report in JSON format:.P.RS 2.nf$ npm audit --json.fi.RE.PFail an audit only if the results include a vulnerability with a level of moderate or higher:.P.RS 2.nf$ npm audit --audit-level=moderate.fi.RE.SS "Configuration".SS "\fBaudit-level\fR".RS 0.IP \(bu 4Default: null.IP \(bu 4Type: null, "info", "low", "moderate", "high", "critical", or "none".RE 0 .PThe minimum level of vulnerability for \fBnpm audit\fR to exit with a non-zero exit code..SS "\fBdry-run\fR".RS 0.IP \(bu 4Default: false.IP \(bu 4Type: Boolean.RE 0 .PIndicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR..PNote: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc..SS "\fBforce\fR".RS 0.IP \(bu 4Default: false.IP \(bu 4Type: Boolean.RE 0 .PRemoves various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input..RS 0.IP \(bu 4Allow clobbering non-npm files in global installs..IP \(bu 4Allow the \fBnpm version\fR command to work on an unclean git repository..IP \(bu 4Allow deleting the cache folder with \fBnpm cache clean\fR..IP \(bu 4Allow installing packages that have an \fBengines\fR declaration requiring a different version of npm..IP \(bu 4Allow installing packages that have an \fBengines\fR declaration requiring a different version of \fBnode\fR, even if \fB--engine-strict\fR is enabled..IP \(bu 4Allow \fBnpm audit fix\fR to install modules outside your stated dependency range (including SemVer-major changes)..IP \(bu 4Allow unpublishing all versions of a published package..IP \(bu 4Allow conflicting peerDependencies to be installed in the root project..IP \(bu 4Implicitly set \fB--yes\fR during \fBnpm init\fR..IP \(bu 4Allow clobbering existing values in \fBnpm pkg\fR.IP \(bu 4Allow unpublishing of entire packages (not just a single version)..RE 0 .PIf you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!.SS "\fBjson\fR".RS 0.IP \(bu 4Default: false.IP \(bu 4Type: Boolean.RE 0 .PWhether or not to output JSON data, rather than the normal output..RS 0.IP \(bu 4In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR..RE 0 .PNot supported by all npm commands..SS "\fBpackage-lock-only\fR".RS 0.IP \(bu 4Default: false.IP \(bu 4Type: Boolean.RE 0 .PIf set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR..PFor \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies..PFor \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR..SS "\fBpackage-lock\fR".RS 0.IP \(bu 4Default: true.IP \(bu 4Type: Boolean.RE 0 .PIf set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true..SS "\fBomit\fR".RS 0.IP \(bu 4Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty..IP \(bu 4Type: "dev", "optional", or "peer" (can be set multiple times).RE 0 .PDependency types to omit from the installation tree on disk..PNote that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk..PIf a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included..PIf the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts..SS "\fBinclude\fR".RS 0.IP \(bu 4Default:.IP \(bu 4Type: "prod", "dev", "optional", or "peer" (can be set multiple times).RE 0 .POption that allows for defining which types of dependencies to install..PThis is the inverse of \fB--omit=<type>\fR..PDependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line..SS "\fBforeground-scripts\fR".RS 0.IP \(bu 4Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR.IP \(bu 4Type: Boolean.RE 0 .PRun all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process..PNote that this will generally make installs run slower, and be much noisier, but can be useful for debugging..SS "\fBignore-scripts\fR".RS 0.IP \(bu 4Default: false.IP \(bu 4Type: Boolean.RE 0 .PIf true, npm does not run scripts specified in package.json files..PNote that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts..SS "\fBworkspace\fR".RS 0.IP \(bu 4Default:.IP \(bu 4Type: String (can be set multiple times).RE 0 .PEnable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option..PValid values for the \fBworkspace\fR config are either:.RS 0.IP \(bu 4Workspace names.IP \(bu 4Path to a workspace directory.IP \(bu 4Path to a parent workspace directory (will result in selecting all workspaces within that folder).RE 0 .PWhen set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project..PThis value is not exported to the environment for child processes..SS "\fBworkspaces\fR".RS 0.IP \(bu 4Default: null.IP \(bu 4Type: null or Boolean.RE 0 .PSet to true to run the command in the context of \fBall\fR configured workspaces..PExplicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly:.RS 0.IP \(bu 4Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config..RE 0 .PThis value is not exported to the environment for child processes..SS "\fBinclude-workspace-root\fR".RS 0.IP \(bu 4Default: false.IP \(bu 4Type: Boolean.RE 0 .PInclude the workspace root when workspaces are enabled for a command..PWhen false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project..PThis value is not exported to the environment for child processes..SS "\fBinstall-links\fR".RS 0.IP \(bu 4Default: false.IP \(bu 4Type: Boolean.RE 0 .PWhen set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces..SS "See Also".RS 0.IP \(bu 4npm help install.IP \(bu 4npm help config.RE 0