CLI documentation update from CI
npm CLI robot committed
Nov 26, 2025 at 02:50 UTC
fc2ee984765009ce3e6f3a6cb15ec509c68f785e
14 files changed
+359
-14
cli-cache.json
+1
-1
@@ -2,5 +2,5 @@
2
"v8": "aa8fff11cdab94fff1a2160ee5241f5f4632e96b",
3
"v9": "64763a341e7aa5b456e696f956759bf9b3440dc1",
4
"v10": "6755ca2d5301b079f9e2581fc72ba2a612171364",
5
- "v11": "3439a89d58a25deac08650da53157595e8b8edfb"
5
+ "v11": "52714855e62a196fb853872f5106803605ab0ec4"
6
}
\ No newline at end of file
content/cli/v11/commands/npm-ls.mdx
+1
-1
@@ -52,7 +52,7 @@ Note: to get a "bottoms up" view of why a given package is included in the tree
52
Positional arguments are `name@version-range` identifiers, which will limit the results to only the paths to the packages named. Note that nested packages will _also_ show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show:
53
54
```bash
55
-npm@11.6.2 /path/to/npm
55
+npm@11.6.4 /path/to/npm
56
└─┬ init-package-json@0.0.4
57
└── promzard@0.1.5
58
```
content/cli/v11/commands/npm-publish.mdx
+26
@@ -45,6 +45,32 @@ npm publish <package-spec>
45
46
Publishes a package to the registry so that it can be installed by name.
47
48
+### Examples
49
+
50
+Publish the package in the current directory:
51
+
52
+```bash
53
+npm publish
54
+```
55
+
56
+Publish a specific workspace:
57
+
58
+```bash
59
+npm publish --workspace=<workspace-name>
60
+```
61
+
62
+Publish multiple workspaces:
63
+
64
+```bash
65
+npm publish --workspace=workspace-a --workspace=workspace-b
66
+```
67
+
68
+Publish all workspaces:
69
+
70
+```bash
71
+npm publish --workspaces
72
+```
73
+
74
By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a [`scope`](/cli/v11/using-npm/scope) in the name, combined with a scope-configured registry (see [`package.json`](/cli/v11/configuring-npm/package-json)).
75
76
A `package` is interpreted the same way as other commands (like `npm install`) and can be:
content/cli/v11/commands/npm-token.mdx
+80
-3
@@ -40,7 +40,7 @@ redirect_from:
40
```bash
41
npm token list
42
npm token revoke <id|token>
43
-npm token create [--read-only] [--cidr=list]
43
+npm token create --name=<name> [--token-description=<desc>] [--packages=<pkg1,pkg2>] [--packages-all] [--scopes=<scope1,scope2>] [--orgs=<org1,org2>] [--packages-and-scopes-permission=<read-only|read-write|no-access>] [--orgs-permission=<read-only|read-write|no-access>] [--expires=<days>] [--cidr=<ip-range>] [--bypass-2fa] [--password=<pass>]
44
```
45
46
Note: This command is unaware of workspaces.
@@ -73,12 +73,68 @@ Created publish token a73c9572-f1b9-8983-983d-ba3ac3cc913d
73
74
### Configuration
75
76
-#### `read-only`
76
+#### `name`
77
+
78
+- Default: null
79
+- Type: null or String
80
+
81
+When creating a Granular Access Token with `npm token create`, this sets the name/description for the token.
82
+
83
+#### `token-description`
84
+
85
+- Default: null
86
+- Type: null or String
87
+
88
+Description text for the token when using `npm token create`.
89
+
90
+#### `expires`
91
+
92
+- Default: null
93
+- Type: null or Number
94
+
95
+When creating a Granular Access Token with `npm token create`, this sets the expiration in days. If not specified, the server will determine the default expiration.
96
+
97
+#### `packages`
98
+
99
+- Default:
100
+- Type: null or String (can be set multiple times)
101
+
102
+When creating a Granular Access Token with `npm token create`, this limits the token access to specific packages. Provide a comma-separated list of package names.
103
+
104
+#### `packages-all`
105
106
- Default: false
107
- Type: Boolean
108
81
-This is used to mark a token as unable to publish when configuring limited access tokens with the `npm token create` command.
109
+When creating a Granular Access Token with `npm token create`, grants the token access to all packages instead of limiting to specific packages.
110
+
111
+#### `scopes`
112
+
113
+- Default: null
114
+- Type: null or String (can be set multiple times)
115
+
116
+When creating a Granular Access Token with `npm token create`, this limits the token access to specific scopes. Provide a comma-separated list of scope names (with or without @ prefix).
117
+
118
+#### `orgs`
119
+
120
+- Default: null
121
+- Type: null or String (can be set multiple times)
122
+
123
+When creating a Granular Access Token with `npm token create`, this limits the token access to specific organizations. Provide a comma-separated list of organization names.
124
+
125
+#### `packages-and-scopes-permission`
126
+
127
+- Default: null
128
+- Type: null, "read-only", "read-write", or "no-access"
129
+
130
+When creating a Granular Access Token with `npm token create`, sets the permission level for packages and scopes. Options are "read-only", "read-write", or "no-access".
131
+
132
+#### `orgs-permission`
133
+
134
+- Default: null
135
+- Type: null, "read-only", "read-write", or "no-access"
136
+
137
+When creating a Granular Access Token with `npm token create`, sets the permission level for organizations. Options are "read-only", "read-write", or "no-access".
138
139
#### `cidr`
140
@@ -87,6 +143,20 @@ This is used to mark a token as unable to publish when configuring limited acces
143
144
This is a list of CIDR address to be used when configuring limited access tokens with the `npm token create` command.
145
146
+#### `bypass-2fa`
147
+
148
+- Default: false
149
+- Type: Boolean
150
+
151
+When creating a Granular Access Token with `npm token create`, setting this to true will allow the token to bypass two-factor authentication. This is useful for automation and CI/CD workflows.
152
+
153
+#### `password`
154
+
155
+- Default: null
156
+- Type: null or String
157
+
158
+Password for authentication. Can be provided via command line when creating tokens, though it's generally safer to be prompted for it.
159
+
160
#### `registry`
161
162
- Default: "https://registry.npmjs.org/"
@@ -103,6 +173,13 @@ This is a one-time password from a two-factor authenticator. It's needed when pu
173
174
If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.
175
176
+#### `read-only`
177
+
178
+- Default: false
179
+- Type: Boolean
180
+
181
+This is used to mark a token as unable to publish when configuring limited access tokens with the `npm token create` command.
182
+
183
### See Also
184
185
- [npm adduser](/cli/v11/commands/npm-adduser)
content/cli/v11/commands/npm-version.mdx
+20
@@ -93,6 +93,17 @@ If set to true, then the `npm version` command will tag the version using `-s` t
93
94
Note that git requires you to have set up GPG keys in your git configs for this to work properly.
95
96
+#### `save`
97
+
98
+- Default: `true` unless when using `npm update` where it defaults to `false`
99
+- Type: Boolean
100
+
101
+Save installed packages to a `package.json` file as dependencies.
102
+
103
+When used with the `npm rm` command, removes the dependency from `package.json`.
104
+
105
+Will also prevent writing to `package-lock.json` if set to `false`.
106
+
107
#### `workspace`
108
109
- Default:
@@ -141,6 +152,15 @@ When false, specifying individual workspaces via the `workspace` config, or all
152
153
This value is not exported to the environment for child processes.
154
155
+#### `ignore-scripts`
156
+
157
+- Default: false
158
+- Type: Boolean
159
+
160
+If true, npm does not run scripts specified in package.json files.
161
+
162
+Note that commands explicitly intended to run a particular script, such as `npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still run their intended script if `ignore-scripts` is set, but they will _not_ run any pre- or post-scripts.
163
+
164
### Description
165
166
Run this in a package directory to bump the version and write the new data back to `package.json`, `package-lock.json`, and, if present, `npm-shrinkwrap.json`.
content/cli/v11/commands/npm.mdx
+3
-3
@@ -31,7 +31,7 @@ Note: This command is unaware of workspaces.
31
32
### Version
33
34
-11.6.2
34
+11.6.4
35
36
### Description
37
@@ -70,7 +70,7 @@ See [`folders`](/cli/v11/configuring-npm/folders) to learn about where npm puts
70
In particular, npm has two modes of operation:
71
72
- local mode: npm installs packages into the current project directory, which defaults to the current working directory. Packages install to `./node_modules`, and bins to `./node_modules/.bin`.
73
-- global mode: npm installs packages into the install prefix at `$npm_config_prefix/lib/node_modules` and bins to `$npm_config_prefix/bin`.
73
+- global mode: npm installs packages into the install prefix at `$NPM_CONFIG_PREFIX/lib/node_modules` and bins to `$NPM_CONFIG_PREFIX/bin`.
74
75
Local mode is the default. Use `-g` or `--global` on any command to run in global mode instead.
76
@@ -89,7 +89,7 @@ If you're using npm to develop and publish your code, check out the following he
89
npm is extremely configurable. It reads its configuration options from 5 places.
90
91
- Command line switches: Set a config with `--key val`. All keys take a value, even if they are booleans (the config parser doesn't know what the options are at the time of parsing). If you do not provide a value (`--key`) then the option is set to boolean `true`.
92
-- Environment Variables: Set any config by prefixing the name in an environment variable with `npm_config_`. For example, `export npm_config_key=val`.
92
+- Environment Variables: Set any config by prefixing the name in an environment variable with `NPM_CONFIG_`. For example, `export NPM_CONFIG_KEY=val`.
93
- User Configs: The file at `$HOME/.npmrc` is an ini-formatted list of configs. If present, it is parsed. If the `userconfig` option is set in the cli or env, that file will be used instead.
94
- Global Configs: The file found at `./etc/npmrc` (relative to the global prefix will be parsed if it is found. See [`npm prefix`](/cli/v11/commands/npm-prefix) for more info on the global prefix. If the `globalconfig` option is set in the cli, env, or user config, then that file is parsed instead.
95
- Defaults: npm's default configuration options are defined in `lib/utils/config/definitions.js`. These must not be changed.
content/cli/v11/configuring-npm/package-json.mdx
+10
@@ -69,6 +69,16 @@ Put a description in it. It's a string. This helps people discover your package,
69
70
Put keywords in it. It's an array of strings. This helps people discover your package as it's listed in `npm search`.
71
72
+Example:
73
+
74
+```json
75
+"keywords": [
76
+ "node",
77
+ "javascript",
78
+ "npm"
79
+]
80
+```
81
+
82
### homepage
83
84
The URL to the project homepage.
content/cli/v11/configuring-npm/package-lock-json.mdx
+6
@@ -122,6 +122,12 @@ Package descriptors have the following fields:
122
123
- bin, license, engines, dependencies, optionalDependencies: fields from `package.json`
124
125
+- os: An array of operating systems this package is compatible with, as specified in `package.json`. This field is included when the package specifies OS restrictions.
126
+
127
+- cpu: An array of CPU architectures this package is compatible with, as specified in `package.json`. This field is included when the package specifies CPU restrictions.
128
+
129
+- funding: Funding information for the package, as specified in `package.json`. This field contains details about how to support the package maintainers.
130
+
131
#### dependencies
132
133
Legacy data for supporting versions of npm that use `lockfileVersion: 1`. This is a mapping of package names to dependency objects. Because the object structure is strictly hierarchical, symbolic link dependencies are somewhat challenging to represent in some cases.
content/cli/v11/using-npm/changelog.mdx
+107
@@ -15,6 +15,113 @@ redirect_from:
15
- /using-npm/changelog
16
---
17
18
+## [11.6.4](https://github.com/npm/cli/compare/v11.6.3...v11.6.4) (2025-11-25)
19
+
20
+### Documentation
21
+
22
+- [`dfb83c7`](https://github.com/npm/cli/commit/dfb83c7887810abd555a2ab62a681858aabe2430) [#8749](https://github.com/npm/cli/pull/8749) add example for keywords field (#8749) (@MaxBlack-dev, Max Black)
23
+- [`1b1e227`](https://github.com/npm/cli/commit/1b1e227d234dc6132832e1a65141260d3601838b) [#8750](https://github.com/npm/cli/pull/8750) remove outdated roadmap link (#8750) (@MaxBlack-dev, Max Black)
24
+- [`1333d57`](https://github.com/npm/cli/commit/1333d576448c3868a29a65cf9cfb0d07ccfccd93) [#8752](https://github.com/npm/cli/pull/8752) clarify .npmrc naming convention for environment variable overrides (#8752) (@MaxBlack-dev)
25
+- [`22cddb8`](https://github.com/npm/cli/commit/22cddb83f884c179258dabe6f20954246074c623) [#8755](https://github.com/npm/cli/pull/8755) add workspace dependencies example to workspaces (Max Black)
26
+- [`17e154c`](https://github.com/npm/cli/commit/17e154cac7394b1baa3987c5b9b168762d9ba4ad) [#8756](https://github.com/npm/cli/pull/8756) standardize env vars to uppercase convention (Max Black)
27
+- [`1e51a25`](https://github.com/npm/cli/commit/1e51a25d02508fbfa1d5d53602d35669115e55ff) [#8754](https://github.com/npm/cli/pull/8754) fix lifecycle event order for prepare script (Max Black)
28
+- [`8d72bc9`](https://github.com/npm/cli/commit/8d72bc99dc705e04e25f24b05cac0f72934608b4) [#8753](https://github.com/npm/cli/pull/8753) add os, cpu, and funding fields to package-lock.json (Max Black)
29
+
30
+### Dependencies
31
+
32
+- [`f56bb13`](https://github.com/npm/cli/commit/f56bb133bbd07f92b32f776f310bcd2aa26cbdfc) [#8779](https://github.com/npm/cli/pull/8779) `proc-log@6.1.0` (#8779)
33
+- [`f963223`](https://github.com/npm/cli/commit/f96322350e497f90a54c8a1cfd952b3329f00492) [#8770](https://github.com/npm/cli/pull/8770) `proggy@4.0.0`
34
+- [`f51e4aa`](https://github.com/npm/cli/commit/f51e4aaf06ac6703abe053a95fe25b8efca3c527) [#8770](https://github.com/npm/cli/pull/8770) `nopt@9.0.0`
35
+- [`2d15040`](https://github.com/npm/cli/commit/2d15040390697cd78c9a9db3f0dbafab51a6e3e9) [#8770](https://github.com/npm/cli/pull/8770) `@npmcli/query@5.0.0`
36
+- [`9d77b84`](https://github.com/npm/cli/commit/9d77b84ce961a28941af8b1a597a03e308828cd4) [#8770](https://github.com/npm/cli/pull/8770) `@npmcli/installed-package-contents@4.0.0`
37
+- [`e2ac092`](https://github.com/npm/cli/commit/e2ac092fdab0ccbf3b20abbac7ff1ebb7cda9a88) [#8770](https://github.com/npm/cli/pull/8770) `read@5.0.1`
38
+- [`6e5bfd9`](https://github.com/npm/cli/commit/6e5bfd93f5423ab0b89fd81493969af108438066) [#8770](https://github.com/npm/cli/pull/8770) `init-package-json@8.2.4`
39
+- [`7f8e237`](https://github.com/npm/cli/commit/7f8e2376e289fc46410f68b7c686d3868ad837c0) [#8770](https://github.com/npm/cli/pull/8770) `p-map@7.0.4`
40
+- [`a4aa218`](https://github.com/npm/cli/commit/a4aa218fa0a3cc5fc65bc516bc4c83fd4bac7fd8) [#8770](https://github.com/npm/cli/pull/8770) `npm-user-validate@4.0.0`
41
+- [`6430446`](https://github.com/npm/cli/commit/643044690be9554366e0cbd5bc42afa77c4acc45) [#8770](https://github.com/npm/cli/pull/8770) `npm-audit-report@7.0.0`
42
+- [`58650dc`](https://github.com/npm/cli/commit/58650dc089c74d090c51d1cb2f269f2d605dcca0) [#8770](https://github.com/npm/cli/pull/8770) `@npmcli/fs@5.0.0`
43
+- [`4a11146`](https://github.com/npm/cli/commit/4a11146aa7e3d06c42793ef5daf3c19b37bdc7ce) [#8770](https://github.com/npm/cli/pull/8770) `glob@13.0.0`
44
+- [`00511d4`](https://github.com/npm/cli/commit/00511d426a7f8d761700b315a0f660854a782353) [#8770](https://github.com/npm/cli/pull/8770) `@npmcli/cacache@20.0.3`
45
+- [`224afa2`](https://github.com/npm/cli/commit/224afa27174f43695ac308de9f849529419a59b2) [#8770](https://github.com/npm/cli/pull/8770) `@npmcli/map-workspaces@5.0.3`
46
+- [`664ac34`](https://github.com/npm/cli/commit/664ac341efef746ac47d08fcd8cc4cc105f1445b) [#8770](https://github.com/npm/cli/pull/8770) `@npmcli/package-json@7.0.4`
47
+- [workspace](https://github.com/npm/cli/releases/tag/arborist-v9.1.8): `@npmcli/arborist@9.1.8`
48
+- [workspace](https://github.com/npm/cli/releases/tag/config-v10.4.4): `@npmcli/config@10.4.4`
49
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v8.0.11): `libnpmdiff@8.0.11`
50
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v10.1.10): `libnpmexec@10.1.10`
51
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v7.0.11): `libnpmfund@7.0.11`
52
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v9.0.11): `libnpmpack@9.0.11`
53
+
54
+## [11.6.3](https://github.com/npm/cli/compare/v11.6.2...v11.6.3) (2025-11-19)
55
+
56
+### Bug Fixes
57
+
58
+- [`c6242d9`](https://github.com/npm/cli/commit/c6242d92e5227e0a772d9cfe474ea57776af79e0) [#8706](https://github.com/npm/cli/pull/8706) change npm profile to create tokens with GAT support (#8706) (@owlstronaut, @wraithgar)
59
+- [`cbc6fa9`](https://github.com/npm/cli/commit/cbc6fa9cd7c582053be77a56677191313c7e8d98) [#8731](https://github.com/npm/cli/pull/8731) order of version information in error message (#8731) (@piotrd, @pd-be)
60
+- [`11dbd7e`](https://github.com/npm/cli/commit/11dbd7e36287695801f02a43e53b24fc2d72a545) [#8709](https://github.com/npm/cli/pull/8709) display full token when creating authentication tokens (#8709) (@MaxBlack-dev, Max Black)
61
+- [`49a4eef`](https://github.com/npm/cli/commit/49a4eefd613dbb60bcff3dac39129f70586d3cff) [#8676](https://github.com/npm/cli/pull/8676) use look behind regex for trailing slash stripping (#8676) (@wraithgar)
62
+- [`b1aee62`](https://github.com/npm/cli/commit/b1aee62082d7b25ec07f64e906afd76840907fbd) [#8645](https://github.com/npm/cli/pull/8645) dep flag calculation (#8645) (@liamcmitchell)
63
+
64
+### Documentation
65
+
66
+- [`ca53c21`](https://github.com/npm/cli/commit/ca53c21e8a0f0e659e891415735e184443b8f48b) [#8745](https://github.com/npm/cli/pull/8745) add workspace usage examples (#8745) (@MaxBlack-dev, Max Black)
67
+- [`e71ca0e`](https://github.com/npm/cli/commit/e71ca0e1934b805c97485b39501653655a54c919) [#8746](https://github.com/npm/cli/pull/8746) add --save flag to documentation (#8746) (@MaxBlack-dev, Max Black)
68
+- [`06510a8`](https://github.com/npm/cli/commit/06510a8720fa180e9ef9093d9caee2e85bbc5165) [#8683](https://github.com/npm/cli/pull/8683) add ignore-scripts option to npm version help and docs (#8683) (@Tejas242)
69
+
70
+### Dependencies
71
+
72
+- [`7f72238`](https://github.com/npm/cli/commit/7f7223833b9f655ea82039cf389ed8d03fb3b212) [#8723](https://github.com/npm/cli/pull/8723) `cacache@20.0.2`
73
+- [`7ac9db8`](https://github.com/npm/cli/commit/7ac9db8564312ffd57a8f622634d6f3de080c472) [#8723](https://github.com/npm/cli/pull/8723) `init-package-json@8.2.3`
74
+- [`41e97c6`](https://github.com/npm/cli/commit/41e97c65d1d9d0bf7fa80d4b018ff4c051b1487b) [#8723](https://github.com/npm/cli/pull/8723) `validate-npm-package-name@7.0.0`
75
+- [`6b1fbe1`](https://github.com/npm/cli/commit/6b1fbe1ef3db7f5782809abdcdf6c53ff7542330) [#8723](https://github.com/npm/cli/pull/8723) `npm-package-arg@13.0.2`
76
+- [`aa1d486`](https://github.com/npm/cli/commit/aa1d486a4e4a82de16d4c63154a1b1a89ad09e6d) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/promise-spawn@9.0.1`
77
+- [`599c819`](https://github.com/npm/cli/commit/599c819e525f235bab08c9395e7f357d4d2454a6) [#8723](https://github.com/npm/cli/pull/8723) `which@6.0.0`
78
+- [`e49286e`](https://github.com/npm/cli/commit/e49286e2189dfe1604d957ccc415038957a64d19) [#8723](https://github.com/npm/cli/pull/8723) `ini@5.0.0`
79
+- [`b7c9f96`](https://github.com/npm/cli/commit/b7c9f960063da93c8476739d1d6a717746255f93) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/promise-spawn@9.0.0`
80
+- [`8cc9f70`](https://github.com/npm/cli/commit/8cc9f70c2769f068ea0ef77a602162cdd949998e) [#8723](https://github.com/npm/cli/pull/8723) `ssri@13.0.0`
81
+- [`0b7274f`](https://github.com/npm/cli/commit/0b7274fa39edacc7103eacf2a72c074d01451284) [#8723](https://github.com/npm/cli/pull/8723) `pacote@21.0.4`
82
+- [`59b3c6a`](https://github.com/npm/cli/commit/59b3c6adf5fb7e5c8e0f990ade7417677270057a) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/redact@4.0.0`
83
+- [`578abad`](https://github.com/npm/cli/commit/578abad64d57dee1db460f1013c8514099e08136) [#8723](https://github.com/npm/cli/pull/8723) `node-gyp@12.1.0`
84
+- [`89c4151`](https://github.com/npm/cli/commit/89c4151a9182ddb77eff1beaeaaa2c0279578a2e) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/git@7.0.1`
85
+- [`c6d109d`](https://github.com/npm/cli/commit/c6d109d7ad59b0be87225917e6393bcc9838f64d) [#8723](https://github.com/npm/cli/pull/8723) `make-fetch-happen@15.0.3`
86
+- [`34d8599`](https://github.com/npm/cli/commit/34d8599987bdd4335391394fc00f80b395fb3a7c) [#8723](https://github.com/npm/cli/pull/8723) `npm-registry-fetch@19.1.1`
87
+- [`4811a86`](https://github.com/npm/cli/commit/4811a86a563d4361b15dd33415857410785a8e81) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/run-script@10.0.3`
88
+- [`6cb77df`](https://github.com/npm/cli/commit/6cb77df37989cb7c165cb2c35c735fb12dc1385a) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/installed-package-contents@4.0.0`
89
+- [`05ac7a7`](https://github.com/npm/cli/commit/05ac7a7ea2a4d258658537a19ba350e07df34fda) [#8723](https://github.com/npm/cli/pull/8723) `proc-log@6.0.0`
90
+- [`0a74f6d`](https://github.com/npm/cli/commit/0a74f6d1d8643f3a089f6e63502df77e6e3038ff) [#8723](https://github.com/npm/cli/pull/8723) `bin-links@6.0.0`
91
+- [`c02ce5c`](https://github.com/npm/cli/commit/c02ce5c132ea6e2b3d1941520228b10a10ad50f1) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/package-json@7.0.2`
92
+- [`9c0cefa`](https://github.com/npm/cli/commit/9c0cefa8417d9e14ee19dd5e833019f0f99ce837) [#8723](https://github.com/npm/cli/pull/8723) `json-parse-even-better-errors@5.0.0`
93
+- [`041b9b2`](https://github.com/npm/cli/commit/041b9b29b30c539c5bf8b8cd26ea2202f94862b3) [#8723](https://github.com/npm/cli/pull/8723) `parse-conflict-json@5.0.1`
94
+- [`a1b0fea`](https://github.com/npm/cli/commit/a1b0feac64ff681b2aec6938eb5136f5e177a07a) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/name-from-folder@4.0.0`
95
+- [`a085745`](https://github.com/npm/cli/commit/a085745da65662f5ce02933b99109f77542fc3bb) [#8723](https://github.com/npm/cli/pull/8723) `abbrev@4.0.0`
96
+- [`00d9c7d`](https://github.com/npm/cli/commit/00d9c7da4173cd48c4295d32d4d8b47d3c8d8701) [#8723](https://github.com/npm/cli/pull/8723) `nopt@9.0.0`
97
+- [`3404dca`](https://github.com/npm/cli/commit/3404dca3d986d1bf0de3e74cf8b61856778711c6) [#8723](https://github.com/npm/cli/pull/8723) `npm-install-checks@8.0.0`
98
+- [`542fcf3`](https://github.com/npm/cli/commit/542fcf3eee92cc41e86838c97c4036a97d749155) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/node-gyp@5.0.0`
99
+- [`89e14d3`](https://github.com/npm/cli/commit/89e14d376fa4d0dc3bb15fefcd932e3f949dbbaa) [#8723](https://github.com/npm/cli/pull/8723) `tar@7.5.2`
100
+- [`5383f3a`](https://github.com/npm/cli/commit/5383f3aa680a028bc6f66ce76383d0259cc5a80d) [#8723](https://github.com/npm/cli/pull/8723) `npm-registry-fetch@19.1.0`
101
+- [`1bb9a7d`](https://github.com/npm/cli/commit/1bb9a7d4ce779cca184d665c7ee4a4d3c9494168) [#8723](https://github.com/npm/cli/pull/8723) `npm-profile@12.0.1`
102
+- [`de619a4`](https://github.com/npm/cli/commit/de619a40eccaa34eafb68b026bd6790ec38d2249) [#8723](https://github.com/npm/cli/pull/8723) `npm-pick-manifest@11.0.3`
103
+- [`0e042ec`](https://github.com/npm/cli/commit/0e042ec4ed6eab646c645506378d409746b324bc) [#8723](https://github.com/npm/cli/pull/8723) `npm-packlist@10.0.3`
104
+- [`2a3c338`](https://github.com/npm/cli/commit/2a3c33871471f327444a0e477199b3c1885683ed) [#8723](https://github.com/npm/cli/pull/8723) `node-gyp@11.5.0`
105
+- [`b96e86c`](https://github.com/npm/cli/commit/b96e86cca5b0c63d98f3cfb92883f9a26882a1dd) [#8723](https://github.com/npm/cli/pull/8723) `minimatch@10.1.1`
106
+- [`d347329`](https://github.com/npm/cli/commit/d347329513229ed2ba5954b996c322e9fd3d807d) [#8723](https://github.com/npm/cli/pull/8723) `exponential-backoff@3.1.3`
107
+- [`d6830f4`](https://github.com/npm/cli/commit/d6830f4fac3b03090d97dce4cac26d5ff0b903d7) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/run-script@10.0.2`
108
+- [`bcc7ec8`](https://github.com/npm/cli/commit/bcc7ec83ad69b2a80d98cfced94553d7f6e8c943) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/metavuln-calculator@9.0.3`
109
+- [`7a419df`](https://github.com/npm/cli/commit/7a419df651b3d8d6fbf9571b80d2f4009e7a5e37) [#8723](https://github.com/npm/cli/pull/8723) `@npmcli/map-workspaces@5.0.1`
110
+
111
+### Chores
112
+
113
+- [`32bdd83`](https://github.com/npm/cli/commit/32bdd833f83cf2a939ed56eba1972d5d729c677c) [#8723](https://github.com/npm/cli/pull/8723) fix package-lock (@wraithgar)
114
+- [`4bff14b`](https://github.com/npm/cli/commit/4bff14b536f70b998b38ca984cbcab94a6c65bf9) [#8670](https://github.com/npm/cli/pull/8670) write tarball to testDir (#8670) (@wraithgar)
115
+- [`679486b`](https://github.com/npm/cli/commit/679486b095f262d478daa21629d01f68f0240c9b) [#8672](https://github.com/npm/cli/pull/8672) fix lockfile (#8672) (@wraithgar)
116
+- [workspace](https://github.com/npm/cli/releases/tag/arborist-v9.1.7): `@npmcli/arborist@9.1.7`
117
+- [workspace](https://github.com/npm/cli/releases/tag/config-v10.4.3): `@npmcli/config@10.4.3`
118
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v8.0.10): `libnpmdiff@8.0.10`
119
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v10.1.9): `libnpmexec@10.1.9`
120
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v7.0.10): `libnpmfund@7.0.10`
121
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v9.0.10): `libnpmpack@9.0.10`
122
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v11.1.3): `libnpmpublish@11.1.3`
123
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmversion-v8.0.3): `libnpmversion@8.0.3`
124
+
125
## [11.6.2](https://github.com/npm/cli/compare/v11.6.1...v11.6.2) (2025-10-08)
126
127
### Bug Fixes
content/cli/v11/using-npm/config.mdx
+79
@@ -35,6 +35,8 @@ Any environment variables that start with `npm_config_` will be interpreted as a
35
36
Notice that you need to use underscores instead of dashes, so `--allow-same-version` would become `npm_config_allow_same_version=true`.
37
38
+**Important:** When defining custom configuration keys in `.npmrc` files, use hyphens instead of underscores (e.g., `custom-key=value`). This ensures they can be overridden by environment variables, since npm automatically converts underscores to hyphens when reading environment variables. Keys with underscores in `.npmrc` files cannot be overridden via environment variables.
39
+
40
#### npmrc Files
41
42
The four relevant files are:
@@ -197,6 +199,13 @@ Set to `false` to suppress browser behavior and instead print urls to terminal.
199
200
Set to `true` to use default system URL opener.
201
202
+#### `bypass-2fa`
203
+
204
+- Default: false
205
+- Type: Boolean
206
+
207
+When creating a Granular Access Token with `npm token create`, setting this to true will allow the token to bypass two-factor authentication. This is useful for automation and CI/CD workflows.
208
+
209
#### `ca`
210
211
- Default: null
@@ -389,6 +398,13 @@ Tells npm whether or not to expect results from the command. Can be either true
398
399
This config cannot be used with: `expect-result-count`
400
401
+#### `expires`
402
+
403
+- Default: null
404
+- Type: null or Number
405
+
406
+When creating a Granular Access Token with `npm token create`, this sets the expiration in days. If not specified, the server will determine the default expiration.
407
+
408
#### `fetch-retries`
409
410
- Default: 2
@@ -756,6 +772,13 @@ Commit message which is used by `npm version` when creating version commit.
772
773
Any "%s" in the message will be replaced with the version number.
774
775
+#### `name`
776
+
777
+- Default: null
778
+- Type: null or String
779
+
780
+When creating a Granular Access Token with `npm token create`, this sets the name/description for the token.
781
+
782
#### `node-gyp`
783
784
- Default: The path to the node-gyp bin that ships with npm
@@ -808,6 +831,20 @@ If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment var
831
832
This option causes npm to create lock files without a `resolved` key for registry dependencies. Subsequent installs will need to resolve tarball endpoints with the configured registry, likely resulting in a longer install time.
833
834
+#### `orgs`
835
+
836
+- Default: null
837
+- Type: null or String (can be set multiple times)
838
+
839
+When creating a Granular Access Token with `npm token create`, this limits the token access to specific organizations. Provide a comma-separated list of organization names.
840
+
841
+#### `orgs-permission`
842
+
843
+- Default: null
844
+- Type: null, "read-only", "read-write", or "no-access"
845
+
846
+When creating a Granular Access Token with `npm token create`, sets the permission level for organizations. Options are "read-only", "read-write", or "no-access".
847
+
848
#### `os`
849
850
- Default: null
@@ -856,6 +893,27 @@ For `update` this means only the `package-lock.json` will be updated, instead of
893
894
For `list` this means the output will be based on the tree described by the `package-lock.json`, rather than the contents of `node_modules`.
895
896
+#### `packages`
897
+
898
+- Default:
899
+- Type: null or String (can be set multiple times)
900
+
901
+When creating a Granular Access Token with `npm token create`, this limits the token access to specific packages. Provide a comma-separated list of package names.
902
+
903
+#### `packages-all`
904
+
905
+- Default: false
906
+- Type: Boolean
907
+
908
+When creating a Granular Access Token with `npm token create`, grants the token access to all packages instead of limiting to specific packages.
909
+
910
+#### `packages-and-scopes-permission`
911
+
912
+- Default: null
913
+- Type: null, "read-only", "read-write", or "no-access"
914
+
915
+When creating a Granular Access Token with `npm token create`, sets the permission level for packages and scopes. Options are "read-only", "read-write", or "no-access".
916
+
917
#### `parseable`
918
919
- Default: false
@@ -863,6 +921,13 @@ For `list` this means the output will be based on the tree described by the `pac
921
922
Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format.
923
924
+#### `password`
925
+
926
+- Default: null
927
+- Type: null or String
928
+
929
+Password for authentication. Can be provided via command line when creating tokens, though it's generally safer to be prompted for it.
930
+
931
#### `prefer-dedupe`
932
933
- Default: false
@@ -1079,6 +1144,13 @@ This will also cause `npm init` to create a scoped package.
1144
npm init --scope=@foo --yes
1145
```
1146
1147
+#### `scopes`
1148
+
1149
+- Default: null
1150
+- Type: null or String (can be set multiple times)
1151
+
1152
+When creating a Granular Access Token with `npm token create`, this limits the token access to specific scopes. Provide a comma-separated list of scope names (with or without @ prefix).
1153
+
1154
#### `script-shell`
1155
1156
- Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
@@ -1192,6 +1264,13 @@ You can quickly view it with this [json](https://npm.im/json) command line: `cat
1264
1265
Timing information will also be reported in the terminal. To suppress this while still writing the timing file, use `--silent`.
1266
1267
+#### `token-description`
1268
+
1269
+- Default: null
1270
+- Type: null or String
1271
+
1272
+Description text for the token when using `npm token create`.
1273
+
1274
#### `umask`
1275
1276
- Default: 0
content/cli/v11/using-npm/scripts.mdx
+2
-2
@@ -47,7 +47,7 @@ There are some special life cycle scripts that happen only in certain situations
47
48
- Runs BEFORE the package is packed, i.e. during `npm publish` and `npm pack`
49
- Runs on local `npm install` without any arguments
50
-- Runs AFTER `prepublish`, but BEFORE `prepublishOnly`
50
+- Runs AFTER `prepublishOnly` and `prepack`, but BEFORE `postpack`
51
- Runs for a package if it's being installed as a link through `npm install <folder>`
52
53
- NOTE: If a package being installed through git contains a `prepare` script, its `dependencies` and `devDependencies` will be installed, and the prepare script will be run, before the package is packaged and installed.
@@ -314,7 +314,7 @@ Note that these script files don't have to be Node.js or even JavaScript program
314
315
- Don't exit with a non-zero error code unless you _really_ mean it. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.
316
- Try not to use scripts to do what npm can do for you. Read through [`package.json`](/cli/v11/configuring-npm/package-json) to see all the things that you can specify and enable by simply describing your package appropriately. In general, this will lead to a more robust and consistent state.
317
-- Inspect the env to determine where to put things. For instance, if the `npm_config_binroot` environment variable is set to `/home/user/bin`, then don't try to install executables into `/usr/local/bin`. The user probably set it up that way for a reason.
317
+- Inspect the env to determine where to put things. For instance, if the `NPM_CONFIG_BINROOT` environment variable is set to `/home/user/bin`, then don't try to install executables into `/usr/local/bin`. The user probably set it up that way for a reason.
318
- Don't prefix your script commands with "sudo". If root permissions are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question.
319
- Don't use `install`. Use a `.gyp` file for compilation, and `prepare` for anything else. You should almost never have to explicitly set a preinstall or install script. If you are doing this, please consider if there is another option. The only valid use of `install` or `preinstall` scripts is for compilation which must be done on the target architecture.
320
content/cli/v11/using-npm/workspaces.mdx
+20
@@ -93,6 +93,26 @@ If you want to add a dependency named `abbrev` from the registry as a dependency
93
npm install abbrev -w a
94
```
95
96
+**Adding a workspace as a dependency of another workspace:**
97
+
98
+If you want to add workspace **b** as a dependency of workspace **a**, you can use the workspace protocol in the dependency specifier:
99
+
100
+```
101
+npm install b@workspace:* -w a
102
+```
103
+
104
+This will add an entry to workspace **a**'s `package.json` like:
105
+
106
+```json
107
+{
108
+ "dependencies": {
109
+ "b": "workspace:*"
110
+ }
111
+}
112
+```
113
+
114
+The `workspace:` protocol tells npm to link to the local workspace rather than fetching from the registry. The `*` version means it will use whatever version is defined in workspace **b**'s `package.json`.
115
+
116
Note: other installing commands such as `uninstall`, `ci`, etc will also respect the provided `workspace` configuration.
117
118
### Using workspaces
content/nav.yml
+1
-1
@@ -1596,7 +1596,7 @@
1596
- title: Changelog
1597
url: /cli/v10/using-npm/changelog
1598
description: Changelog notes for each version
1599
- - title: Version 11.6.2
1599
+ - title: Version 11.6.4
1600
shortName: v11
1601
url: /cli/v11
1602
default: true
package-lock.json
+3
-3
@@ -36124,9 +36124,9 @@
36124
}
36125
},
36126
"node_modules/proc-log": {
36127
- "version": "6.0.0",
36128
- "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-6.0.0.tgz",
36129
- "integrity": "sha512-KG/XsTDN901PNfPfAMmj6N/Ywg9tM+bHK8pAz+27fS4N4Pcr+4zoYBOcGSBu6ceXYNPxkLpa4ohtfxV1XcLAfA==",
36127
+ "version": "6.1.0",
36128
+ "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-6.1.0.tgz",
36129
+ "integrity": "sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==",
36130
"license": "ISC",
36131
"engines": {
36132
"node": "^20.17.0 || >=22.9.0"