1NPM-INSTALL-TEST(1) NPM-INSTALL-TEST(1)
2
3
4
6 npm-install-test - Install package(s) and run tests
7
8 Synopsis
9 npm install-test [<package-spec> ...]
10
11 alias: it
12
13 Description
14 This command runs an npm install followed immediately by an npm test.
15 It takes exactly the same arguments as npm install.
16
17 Configuration
18 save
19 • Default: true unless when using npm update where it defaults to
20 false
21
22 • Type: Boolean
23
24
25 Save installed packages to a package.json file as dependencies.
26
27 When used with the npm rm command, removes the dependency from pack‐
28 age.json.
29
30 Will also prevent writing to package-lock.json if set to false.
31
32 save-exact
33 • Default: false
34
35 • Type: Boolean
36
37
38 Dependencies saved to package.json will be configured with an exact
39 version rather than using npm's default semver range operator.
40
41 global
42 • Default: false
43
44 • Type: Boolean
45
46
47 Operates in "global" mode, so that packages are installed into the pre‐
48 fix folder instead of the current working directory. See npm help fold‐
49 ers for more on the differences in behavior.
50
51 • packages are installed into the {prefix}/lib/node_modules folder,
52 instead of the current working directory.
53
54 • bin files are linked to {prefix}/bin
55
56 • man pages are linked to {prefix}/share/man
57
58
59 install-strategy
60 • Default: "hoisted"
61
62 • Type: "hoisted", "nested", "shallow", or "linked"
63
64
65 Sets the strategy for installing packages in node_modules. hoisted (de‐
66 fault): Install non-duplicated in top-level, and duplicated as neces‐
67 sary within directory structure. nested: (formerly --legacy-bundling)
68 install in place, no hoisting. shallow (formerly --global-style) only
69 install direct deps at top-level. linked: (experimental) install in
70 node_modules/.store, link in place, unhoisted.
71
72 legacy-bundling
73 • Default: false
74
75 • Type: Boolean
76
77 • DEPRECATED: This option has been deprecated in favor of --install-
78 strategy=nested
79
80
81 Instead of hoisting package installs in node_modules, install packages
82 in the same manner that they are depended on. This may cause very deep
83 directory structures and duplicate package installs as there is no de-
84 duplicating. Sets --install-strategy=nested.
85
86 global-style
87 • Default: false
88
89 • Type: Boolean
90
91 • DEPRECATED: This option has been deprecated in favor of --install-
92 strategy=shallow
93
94
95 Only install direct dependencies in the top level node_modules, but
96 hoist on deeper dependencies. Sets --install-strategy=shallow.
97
98 omit
99 • Default: 'dev' if the NODE_ENV environment variable is set to 'pro‐
100 duction', otherwise empty.
101
102 • Type: "dev", "optional", or "peer" (can be set multiple times)
103
104
105 Dependency types to omit from the installation tree on disk.
106
107 Note that these dependencies are still resolved and added to the pack‐
108 age-lock.json or npm-shrinkwrap.json file. They are just not physically
109 installed on disk.
110
111 If a package type appears in both the --include and --omit lists, then
112 it will be included.
113
114 If the resulting omit list includes 'dev', then the NODE_ENV environ‐
115 ment variable will be set to 'production' for all lifecycle scripts.
116
117 include
118 • Default:
119
120 • Type: "prod", "dev", "optional", or "peer" (can be set multiple
121 times)
122
123
124 Option that allows for defining which types of dependencies to install.
125
126 This is the inverse of --omit=<type>.
127
128 Dependency types specified in --include will not be omitted, regardless
129 of the order in which omit/include are specified on the command-line.
130
131 strict-peer-deps
132 • Default: false
133
134 • Type: Boolean
135
136
137 If set to true, and --legacy-peer-deps is not set, then any conflicting
138 peerDependencies will be treated as an install failure, even if npm
139 could reasonably guess the appropriate resolution based on non-peer de‐
140 pendency relationships.
141
142 By default, conflicting peerDependencies deep in the dependency graph
143 will be resolved using the nearest non-peer dependency specification,
144 even if doing so will result in some packages receiving a peer depen‐
145 dency outside the range set in their package's peerDependencies object.
146
147 When such an override is performed, a warning is printed, explaining
148 the conflict and the packages involved. If --strict-peer-deps is set,
149 then this warning is treated as a failure.
150
151 prefer-dedupe
152 • Default: false
153
154 • Type: Boolean
155
156
157 Prefer to deduplicate packages if possible, rather than choosing a
158 newer version of a dependency.
159
160 package-lock
161 • Default: true
162
163 • Type: Boolean
164
165
166 If set to false, then ignore package-lock.json files when installing.
167 This will also prevent writing package-lock.json if save is true.
168
169 package-lock-only
170 • Default: false
171
172 • Type: Boolean
173
174
175 If set to true, the current operation will only use the package-
176 lock.json, ignoring node_modules.
177
178 For update this means only the package-lock.json will be updated, in‐
179 stead of checking node_modules and downloading dependencies.
180
181 For list this means the output will be based on the tree described by
182 the package-lock.json, rather than the contents of node_modules.
183
184 foreground-scripts
185 • Default: false
186
187 • Type: Boolean
188
189
190 Run all build scripts (ie, preinstall, install, and postinstall)
191 scripts for installed packages in the foreground process, sharing stan‐
192 dard input, output, and error with the main npm process.
193
194 Note that this will generally make installs run slower, and be much
195 noisier, but can be useful for debugging.
196
197 ignore-scripts
198 • Default: false
199
200 • Type: Boolean
201
202
203 If true, npm does not run scripts specified in package.json files.
204
205 Note that commands explicitly intended to run a particular script, such
206 as npm start, npm stop, npm restart, npm test, and npm run-script will
207 still run their intended script if ignore-scripts is set, but they will
208 not run any pre- or post-scripts.
209
210 audit
211 • Default: true
212
213 • Type: Boolean
214
215
216 When "true" submit audit reports alongside the current npm command to
217 the default registry and all registries configured for scopes. See the
218 documentation for npm help audit for details on what is submitted.
219
220 bin-links
221 • Default: true
222
223 • Type: Boolean
224
225
226 Tells npm to create symlinks (or .cmd shims on Windows) for package ex‐
227 ecutables.
228
229 Set to false to have it not do this. This can be used to work around
230 the fact that some file systems don't support symlinks, even on osten‐
231 sibly Unix systems.
232
233 fund
234 • Default: true
235
236 • Type: Boolean
237
238
239 When "true" displays the message at the end of each npm install ac‐
240 knowledging the number of dependencies looking for funding. See npm
241 help fund for details.
242
243 dry-run
244 • Default: false
245
246 • Type: Boolean
247
248
249 Indicates that you don't want npm to make any changes and that it
250 should only report what it would have done. This can be passed into any
251 of the commands that modify your local installation, eg, install, up‐
252 date, dedupe, uninstall, as well as pack and publish.
253
254 Note: This is NOT honored by other network related commands, eg dist-
255 tags, owner, etc.
256
257 cpu
258 • Default: null
259
260 • Type: null or String
261
262
263 Override CPU architecture of native modules to install. Acceptable val‐
264 ues are same as cpu field of package.json, which comes from
265 process.arch.
266
267 os
268 • Default: null
269
270 • Type: null or String
271
272
273 Override OS of native modules to install. Acceptable values are same as
274 os field of package.json, which comes from process.platform.
275
276 workspace
277 • Default:
278
279 • Type: String (can be set multiple times)
280
281
282 Enable running a command in the context of the configured workspaces of
283 the current project while filtering by running only the workspaces de‐
284 fined by this configuration option.
285
286 Valid values for the workspace config are either:
287
288 • Workspace names
289
290 • Path to a workspace directory
291
292 • Path to a parent workspace directory (will result in selecting all
293 workspaces within that folder)
294
295
296 When set for the npm init command, this may be set to the folder of a
297 workspace which does not yet exist, to create the folder and set it up
298 as a brand new workspace within the project.
299
300 This value is not exported to the environment for child processes.
301
302 workspaces
303 • Default: null
304
305 • Type: null or Boolean
306
307
308 Set to true to run the command in the context of all configured
309 workspaces.
310
311 Explicitly setting this to false will cause commands like install to
312 ignore workspaces altogether. When not set explicitly:
313
314 • Commands that operate on the node_modules tree (install, update,
315 etc.) will link workspaces into the node_modules folder. - Commands
316 that do other things (test, exec, publish, etc.) will operate on
317 the root project, unless one or more workspaces are specified in
318 the workspace config.
319
320
321 This value is not exported to the environment for child processes.
322
323 include-workspace-root
324 • Default: false
325
326 • Type: Boolean
327
328
329 Include the workspace root when workspaces are enabled for a command.
330
331 When false, specifying individual workspaces via the workspace config,
332 or all workspaces via the workspaces flag, will cause npm to operate
333 only on the specified workspaces, and not on the root project.
334
335 This value is not exported to the environment for child processes.
336
337 install-links
338 • Default: false
339
340 • Type: Boolean
341
342
343 When set file: protocol dependencies will be packed and installed as
344 regular dependencies instead of creating a symlink. This option has no
345 effect on workspaces.
346
347 See Also
348 • npm help install
349
350 • npm help install-ci-test
351
352 • npm help test
353
354
355
356 November 2023 NPM-INSTALL-TEST(1)