Skip to content

Commit d8fae16

Browse files
committed
CLI documentation update from CI
1 parent d041f57 commit d8fae16

File tree

6 files changed

+500
-24
lines changed

6 files changed

+500
-24
lines changed

content/cli/v8/commands/npm-ci.md

Lines changed: 243 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,129 @@ cache:
9494
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
9595
<!-- automatically generated, do not edit manually -->
9696
<!-- see lib/utils/config/definitions.js -->
97-
#### `audit`
97+
#### `save`
98+
99+
* Default: `true` unless when using `npm update` where it defaults to `false`
100+
* Type: Boolean
101+
102+
Save installed packages to a `package.json` file as dependencies.
103+
104+
When used with the `npm rm` command, removes the dependency from
105+
`package.json`.
106+
107+
Will also prevent writing to `package-lock.json` if set to `false`.
108+
109+
<!-- automatically generated, do not edit manually -->
110+
<!-- see lib/utils/config/definitions.js -->
111+
112+
#### `save-exact`
113+
114+
* Default: false
115+
* Type: Boolean
116+
117+
Dependencies saved to package.json will be configured with an exact version
118+
rather than using npm's default semver range operator.
119+
120+
<!-- automatically generated, do not edit manually -->
121+
<!-- see lib/utils/config/definitions.js -->
122+
123+
#### `global`
124+
125+
* Default: false
126+
* Type: Boolean
127+
128+
Operates in "global" mode, so that packages are installed into the `prefix`
129+
folder instead of the current working directory. See
130+
[folders](/cli/v8/configuring-npm/folders) for more on the differences in behavior.
131+
132+
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
133+
of the current working directory.
134+
* bin files are linked to `{prefix}/bin`
135+
* man pages are linked to `{prefix}/share/man`
136+
137+
<!-- automatically generated, do not edit manually -->
138+
<!-- see lib/utils/config/definitions.js -->
139+
140+
#### `global-style`
141+
142+
* Default: false
143+
* Type: Boolean
144+
145+
Causes npm to install the package into your local `node_modules` folder with
146+
the same layout it uses with the global `node_modules` folder. Only your
147+
direct dependencies will show in `node_modules` and everything they depend
148+
on will be flattened in their `node_modules` folders. This obviously will
149+
eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
150+
will be preferred.
151+
152+
<!-- automatically generated, do not edit manually -->
153+
<!-- see lib/utils/config/definitions.js -->
154+
155+
#### `legacy-bundling`
156+
157+
* Default: false
158+
* Type: Boolean
159+
160+
Causes npm to install the package such that versions of npm prior to 1.4,
161+
such as the one included with node 0.8, can install the package. This
162+
eliminates all automatic deduping. If used with `global-style` this option
163+
will be preferred.
164+
165+
<!-- automatically generated, do not edit manually -->
166+
<!-- see lib/utils/config/definitions.js -->
167+
168+
#### `omit`
169+
170+
* Default: 'dev' if the `NODE_ENV` environment variable is set to
171+
'production', otherwise empty.
172+
* Type: "dev", "optional", or "peer" (can be set multiple times)
173+
174+
Dependency types to omit from the installation tree on disk.
175+
176+
Note that these dependencies _are_ still resolved and added to the
177+
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
178+
physically installed on disk.
179+
180+
If a package type appears in both the `--include` and `--omit` lists, then
181+
it will be included.
182+
183+
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
184+
variable will be set to `'production'` for all lifecycle scripts.
185+
186+
<!-- automatically generated, do not edit manually -->
187+
<!-- see lib/utils/config/definitions.js -->
188+
189+
#### `strict-peer-deps`
190+
191+
* Default: false
192+
* Type: Boolean
193+
194+
If set to `true`, and `--legacy-peer-deps` is not set, then _any_
195+
conflicting `peerDependencies` will be treated as an install failure, even
196+
if npm could reasonably guess the appropriate resolution based on non-peer
197+
dependency relationships.
198+
199+
By default, conflicting `peerDependencies` deep in the dependency graph will
200+
be resolved using the nearest non-peer dependency specification, even if
201+
doing so will result in some packages receiving a peer dependency outside
202+
the range set in their package's `peerDependencies` object.
203+
204+
When such and override is performed, a warning is printed, explaining the
205+
conflict and the packages involved. If `--strict-peer-deps` is set, then
206+
this warning is treated as a failure.
207+
208+
<!-- automatically generated, do not edit manually -->
209+
<!-- see lib/utils/config/definitions.js -->
210+
211+
#### `package-lock`
98212

99213
* Default: true
100214
* Type: Boolean
101215

102-
When "true" submit audit reports alongside the current npm command to the
103-
default registry and all registries configured for scopes. See the
104-
documentation for [`npm audit`](/cli/v8/commands/npm-audit) for details on what is
105-
submitted.
216+
If set to false, then ignore `package-lock.json` files when installing. This
217+
will also prevent _writing_ `package-lock.json` if `save` is true.
218+
219+
This configuration does not affect `npm ci`.
106220

107221
<!-- automatically generated, do not edit manually -->
108222
<!-- see lib/utils/config/definitions.js -->
@@ -137,13 +251,132 @@ will *not* run any pre- or post-scripts.
137251
<!-- automatically generated, do not edit manually -->
138252
<!-- see lib/utils/config/definitions.js -->
139253

140-
#### `script-shell`
254+
#### `audit`
141255

142-
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
143-
* Type: null or String
256+
* Default: true
257+
* Type: Boolean
258+
259+
When "true" submit audit reports alongside the current npm command to the
260+
default registry and all registries configured for scopes. See the
261+
documentation for [`npm audit`](/cli/v8/commands/npm-audit) for details on what is
262+
submitted.
263+
264+
<!-- automatically generated, do not edit manually -->
265+
<!-- see lib/utils/config/definitions.js -->
266+
267+
#### `bin-links`
268+
269+
* Default: true
270+
* Type: Boolean
271+
272+
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
273+
executables.
274+
275+
Set to false to have it not do this. This can be used to work around the
276+
fact that some file systems don't support symlinks, even on ostensibly Unix
277+
systems.
278+
279+
<!-- automatically generated, do not edit manually -->
280+
<!-- see lib/utils/config/definitions.js -->
281+
282+
#### `fund`
283+
284+
* Default: true
285+
* Type: Boolean
286+
287+
When "true" displays the message at the end of each `npm install`
288+
acknowledging the number of dependencies looking for funding. See [`npm
289+
fund`](/cli/v8/commands/npm-fund) for details.
290+
291+
<!-- automatically generated, do not edit manually -->
292+
<!-- see lib/utils/config/definitions.js -->
293+
294+
#### `dry-run`
295+
296+
* Default: false
297+
* Type: Boolean
298+
299+
Indicates that you don't want npm to make any changes and that it should
300+
only report what it would have done. This can be passed into any of the
301+
commands that modify your local installation, eg, `install`, `update`,
302+
`dedupe`, `uninstall`, as well as `pack` and `publish`.
303+
304+
Note: This is NOT honored by other network related commands, eg `dist-tags`,
305+
`owner`, etc.
306+
307+
<!-- automatically generated, do not edit manually -->
308+
<!-- see lib/utils/config/definitions.js -->
309+
310+
#### `workspace`
311+
312+
* Default:
313+
* Type: String (can be set multiple times)
314+
315+
Enable running a command in the context of the configured workspaces of the
316+
current project while filtering by running only the workspaces defined by
317+
this configuration option.
318+
319+
Valid values for the `workspace` config are either:
320+
321+
* Workspace names
322+
* Path to a workspace directory
323+
* Path to a parent workspace directory (will result in selecting all
324+
workspaces within that folder)
325+
326+
When set for the `npm init` command, this may be set to the folder of a
327+
workspace which does not yet exist, to create the folder and set it up as a
328+
brand new workspace within the project.
329+
330+
This value is not exported to the environment for child processes.
331+
332+
<!-- automatically generated, do not edit manually -->
333+
<!-- see lib/utils/config/definitions.js -->
334+
335+
#### `workspaces`
336+
337+
* Default: null
338+
* Type: null or Boolean
339+
340+
Set to true to run the command in the context of **all** configured
341+
workspaces.
342+
343+
Explicitly setting this to false will cause commands like `install` to
344+
ignore workspaces altogether. When not set explicitly:
345+
346+
- Commands that operate on the `node_modules` tree (install, update, etc.)
347+
will link workspaces into the `node_modules` folder. - Commands that do
348+
other things (test, exec, publish, etc.) will operate on the root project,
349+
_unless_ one or more workspaces are specified in the `workspace` config.
350+
351+
This value is not exported to the environment for child processes.
352+
353+
<!-- automatically generated, do not edit manually -->
354+
<!-- see lib/utils/config/definitions.js -->
355+
356+
#### `include-workspace-root`
357+
358+
* Default: false
359+
* Type: Boolean
360+
361+
Include the workspace root when workspaces are enabled for a command.
362+
363+
When false, specifying individual workspaces via the `workspace` config, or
364+
all workspaces via the `workspaces` flag, will cause npm to operate only on
365+
the specified workspaces, and not on the root project.
366+
367+
This value is not exported to the environment for child processes.
368+
369+
<!-- automatically generated, do not edit manually -->
370+
<!-- see lib/utils/config/definitions.js -->
371+
372+
#### `install-links`
373+
374+
* Default: false
375+
* Type: Boolean
144376

145-
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
146-
init <package-spec>` commands.
377+
When set file: protocol dependencies that exist outside of the project root
378+
will be packed and installed as regular dependencies instead of creating a
379+
symlink. This option has no effect on workspaces.
147380

148381
<!-- automatically generated, do not edit manually -->
149382
<!-- see lib/utils/config/definitions.js -->

content/cli/v8/commands/npm-init.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ follows:
4848
* `npm init foo` -> `npm exec create-foo`
4949
* `npm init @usr/foo` -> `npm exec @usr/create-foo`
5050
* `npm init @usr` -> `npm exec @usr/create`
51+
* `npm init @usr@2.0.0` -> `npm exec @usr/create@2.0.0`
52+
* `npm init @usr/foo@2.0.0` -> `npm exec @usr/create-foo@2.0.0`
5153

5254
If the initializer is omitted (by just calling `npm init`), init will fall
5355
back to legacy init behavior. It will ask you a bunch of questions, and

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy