codekingpro/portable-devtools
114k
1.TH "NPM-INSTALL-TEST" "1" "April 2026" "NPM@11.13.0" ""
2.SH "NAME"
3\fBnpm-install-test\fR - Install package(s) and run tests
4.SS "Synopsis"
5.P
6.RS 2
7.nf
8npm install-test \[lB]<package-spec> ...\[rB]
9
10alias: it
11.fi
12.RE
13.SS "Description"
14.P
15This command runs an \fBnpm install\fR followed immediately by an \fBnpm test\fR. It takes exactly the same arguments as \fBnpm install\fR.
16.SS "Configuration"
17.SS "\fBsave\fR"
18.RS 0
19.IP \(bu 4
20Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR
21.IP \(bu 4
22Type: Boolean
23.RE 0
24
25.P
26Save installed packages to a \fBpackage.json\fR file as dependencies.
27.P
28When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR.
29.P
30Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR.
31.SS "\fBsave-exact\fR"
32.RS 0
33.IP \(bu 4
34Default: false
35.IP \(bu 4
36Type: Boolean
37.RE 0
38
39.P
40Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator.
41.SS "\fBglobal\fR"
42.RS 0
43.IP \(bu 4
44Default: false
45.IP \(bu 4
46Type: Boolean
47.RE 0
48
49.P
50Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior.
51.RS 0
52.IP \(bu 4
53packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory.
54.IP \(bu 4
55bin files are linked to \fB{prefix}/bin\fR
56.IP \(bu 4
57man pages are linked to \fB{prefix}/share/man\fR
58.RE 0
59
60.SS "\fBinstall-strategy\fR"
61.RS 0
62.IP \(bu 4
63Default: "hoisted"
64.IP \(bu 4
65Type: "hoisted", "nested", "shallow", or "linked"
66.RE 0
67
68.P
69Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted.
70.SS "\fBlegacy-bundling\fR"
71.RS 0
72.IP \(bu 4
73Default: false
74.IP \(bu 4
75Type: Boolean
76.IP \(bu 4
77DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR
78.RE 0
79
80.P
81Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR.
82.SS "\fBglobal-style\fR"
83.RS 0
84.IP \(bu 4
85Default: false
86.IP \(bu 4
87Type: Boolean
88.IP \(bu 4
89DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR
90.RE 0
91
92.P
93Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR.
94.SS "\fBomit\fR"
95.RS 0
96.IP \(bu 4
97Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty.
98.IP \(bu 4
99Type: "dev", "optional", or "peer" (can be set multiple times)
100.RE 0
101
102.P
103Dependency types to omit from the installation tree on disk.
104.P
105Note 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.
106.P
107If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included.
108.P
109If 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.
110.SS "\fBinclude\fR"
111.RS 0
112.IP \(bu 4
113Default:
114.IP \(bu 4
115Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
116.RE 0
117
118.P
119Option that allows for defining which types of dependencies to install.
120.P
121This is the inverse of \fB--omit=<type>\fR.
122.P
123Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line.
124.SS "\fBstrict-peer-deps\fR"
125.RS 0
126.IP \(bu 4
127Default: false
128.IP \(bu 4
129Type: Boolean
130.RE 0
131
132.P
133If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships.
134.P
135By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object.
136.P
137When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure.
138.SS "\fBprefer-dedupe\fR"
139.RS 0
140.IP \(bu 4
141Default: false
142.IP \(bu 4
143Type: Boolean
144.RE 0
145
146.P
147Prefer to deduplicate packages if possible, rather than choosing a newer version of a dependency.
148.SS "\fBpackage-lock\fR"
149.RS 0
150.IP \(bu 4
151Default: true
152.IP \(bu 4
153Type: Boolean
154.RE 0
155
156.P
157If 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.
158.SS "\fBpackage-lock-only\fR"
159.RS 0
160.IP \(bu 4
161Default: false
162.IP \(bu 4
163Type: Boolean
164.RE 0
165
166.P
167If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR.
168.P
169For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies.
170.P
171For \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.
172.SS "\fBforeground-scripts\fR"
173.RS 0
174.IP \(bu 4
175Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR
176.IP \(bu 4
177Type: Boolean
178.RE 0
179
180.P
181Run 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.
182.P
183Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging.
184.SS "\fBignore-scripts\fR"
185.RS 0
186.IP \(bu 4
187Default: false
188.IP \(bu 4
189Type: Boolean
190.RE 0
191
192.P
193If true, npm does not run scripts specified in package.json files.
194.P
195Note 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.
196.SS "\fBallow-git\fR"
197.RS 0
198.IP \(bu 4
199Default: "all"
200.IP \(bu 4
201Type: "all", "none", or "root"
202.RE 0
203
204.P
205Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed.
206.P
207\fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR
208.SS "\fBaudit\fR"
209.RS 0
210.IP \(bu 4
211Default: true
212.IP \(bu 4
213Type: Boolean
214.RE 0
215
216.P
217When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted.
218.SS "\fBbefore\fR"
219.RS 0
220.IP \(bu 4
221Default: null
222.IP \(bu 4
223Type: null or Date
224.RE 0
225
226.P
227If passed to \fBnpm install\fR, will rebuild the npm tree such that only versions that were available \fBon or before\fR the given date are installed. If there are no versions available for the current set of dependencies, the command will error.
228.P
229If the requested version is a \fBdist-tag\fR and the given tag does not pass the \fB--before\fR filter, the most recent version less than or equal to that tag will be used. For example, \fBfoo@latest\fR might install \fBfoo@1.2\fR even though \fBlatest\fR is \fB2.0\fR.
230.P
231This config cannot be used with: \fBmin-release-age\fR
232.SS "\fBmin-release-age\fR"
233.RS 0
234.IP \(bu 4
235Default: null
236.IP \(bu 4
237Type: null or Number
238.RE 0
239
240.P
241If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error.
242.P
243This flag is a complement to \fBbefore\fR, which accepts an exact date instead of a relative number of days.
244.P
245This config cannot be used with: \fBbefore\fR
246.P
247This value is not exported to the environment for child processes.
248.SS "\fBbin-links\fR"
249.RS 0
250.IP \(bu 4
251Default: true
252.IP \(bu 4
253Type: Boolean
254.RE 0
255
256.P
257Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables.
258.P
259Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems.
260.SS "\fBfund\fR"
261.RS 0
262.IP \(bu 4
263Default: true
264.IP \(bu 4
265Type: Boolean
266.RE 0
267
268.P
269When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details.
270.SS "\fBdry-run\fR"
271.RS 0
272.IP \(bu 4
273Default: false
274.IP \(bu 4
275Type: Boolean
276.RE 0
277
278.P
279Indicates 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.
280.P
281Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc.
282.SS "\fBcpu\fR"
283.RS 0
284.IP \(bu 4
285Default: null
286.IP \(bu 4
287Type: null or String
288.RE 0
289
290.P
291Override CPU architecture of native modules to install. Acceptable values are same as \fBcpu\fR field of package.json, which comes from \fBprocess.arch\fR.
292.SS "\fBos\fR"
293.RS 0
294.IP \(bu 4
295Default: null
296.IP \(bu 4
297Type: null or String
298.RE 0
299
300.P
301Override OS of native modules to install. Acceptable values are same as \fBos\fR field of package.json, which comes from \fBprocess.platform\fR.
302.SS "\fBlibc\fR"
303.RS 0
304.IP \(bu 4
305Default: null
306.IP \(bu 4
307Type: null or String
308.RE 0
309
310.P
311Override libc of native modules to install. Acceptable values are same as \fBlibc\fR field of package.json
312.SS "\fBworkspace\fR"
313.RS 0
314.IP \(bu 4
315Default:
316.IP \(bu 4
317Type: String (can be set multiple times)
318.RE 0
319
320.P
321Enable 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.
322.P
323Valid values for the \fBworkspace\fR config are either:
324.RS 0
325.IP \(bu 4
326Workspace names
327.IP \(bu 4
328Path to a workspace directory
329.IP \(bu 4
330Path to a parent workspace directory (will result in selecting all workspaces within that folder)
331.RE 0
332
333.P
334When 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.
335.P
336This value is not exported to the environment for child processes.
337.SS "\fBworkspaces\fR"
338.RS 0
339.IP \(bu 4
340Default: null
341.IP \(bu 4
342Type: null or Boolean
343.RE 0
344
345.P
346Set to true to run the command in the context of \fBall\fR configured workspaces.
347.P
348Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly:
349.RS 0
350.IP \(bu 4
351Commands 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.
352.RE 0
353
354.P
355This value is not exported to the environment for child processes.
356.SS "\fBinclude-workspace-root\fR"
357.RS 0
358.IP \(bu 4
359Default: false
360.IP \(bu 4
361Type: Boolean
362.RE 0
363
364.P
365Include the workspace root when workspaces are enabled for a command.
366.P
367When 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.
368.P
369This value is not exported to the environment for child processes.
370.SS "\fBinstall-links\fR"
371.RS 0
372.IP \(bu 4
373Default: false
374.IP \(bu 4
375Type: Boolean
376.RE 0
377
378.P
379When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces.
380.SS "See Also"
381.RS 0
382.IP \(bu 4
383npm help install
384.IP \(bu 4
385npm help install-ci-test
386.IP \(bu 4
387npm help test
388.RE 0
389 