codekingpro/portable-devtools
114k
1<!DOCTYPE html><html><head>
2<meta charset="utf-8">
3<title>npm-install-test</title>
4<style>
5body {
6 background-color: #ffffff;
7 color: #24292e;
8
9 margin: 0;
10
11 line-height: 1.5;
12
13 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
14}
15#rainbar {
16 height: 10px;
17 background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
18}
19
20a {
21 text-decoration: none;
22 color: #0366d6;
23}
24a:hover {
25 text-decoration: underline;
26}
27
28pre {
29 margin: 1em 0px;
30 padding: 1em;
31 border: solid 1px #e1e4e8;
32 border-radius: 6px;
33
34 display: block;
35 overflow: auto;
36
37 white-space: pre;
38
39 background-color: #f6f8fa;
40 color: #393a34;
41}
42code {
43 font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
44 font-size: 85%;
45 padding: 0.2em 0.4em;
46 background-color: #f6f8fa;
47 color: #393a34;
48}
49pre > code {
50 padding: 0;
51 background-color: inherit;
52 color: inherit;
53}
54h1, h2, h3 {
55 font-weight: 600;
56}
57
58#logobar {
59 background-color: #333333;
60 margin: 0 auto;
61 padding: 1em 4em;
62}
63#logobar .logo {
64 float: left;
65}
66#logobar .title {
67 font-weight: 600;
68 color: #dddddd;
69 float: left;
70 margin: 5px 0 0 1em;
71}
72#logobar:after {
73 content: "";
74 display: block;
75 clear: both;
76}
77
78#content {
79 margin: 0 auto;
80 padding: 0 4em;
81}
82
83#table_of_contents > h2 {
84 font-size: 1.17em;
85}
86#table_of_contents ul:first-child {
87 border: solid 1px #e1e4e8;
88 border-radius: 6px;
89 padding: 1em;
90 background-color: #f6f8fa;
91 color: #393a34;
92}
93#table_of_contents ul {
94 list-style-type: none;
95 padding-left: 1.5em;
96}
97#table_of_contents li {
98 font-size: 0.9em;
99}
100#table_of_contents li a {
101 color: #000000;
102}
103
104header.title {
105 border-bottom: solid 1px #e1e4e8;
106}
107header.title > h1 {
108 margin-bottom: 0.25em;
109}
110header.title > .description {
111 display: block;
112 margin-bottom: 0.5em;
113 line-height: 1;
114}
115
116header.title .version {
117 font-size: 0.8em;
118 color: #666666;
119}
120
121footer#edit {
122 border-top: solid 1px #e1e4e8;
123 margin: 3em 0 4em 0;
124 padding-top: 2em;
125}
126
127table {
128 width: 100%;
129 margin: 1em 0;
130 border-radius: 6px;
131 border: 1px solid #e1e4e8;
132 overflow: hidden;
133 border-collapse: separate;
134 border-spacing: 0;
135}
136
137table thead {
138 background-color: #f6f8fa;
139}
140
141table tbody {
142 background-color: #ffffff;
143}
144
145table th,
146table td {
147 padding: 0.75em;
148 text-align: left;
149 border-right: 1px solid #e1e4e8;
150 border-bottom: 1px solid #e1e4e8;
151}
152
153table th:last-child,
154table td:last-child {
155 border-right: none;
156}
157
158table tbody tr:last-child td {
159 border-bottom: none;
160}
161
162table th {
163 font-weight: 600;
164 background-color: #f6f8fa;
165}
166
167table code {
168 white-space: nowrap;
169}
170
171</style>
172</head>
173<body>
174<div id="banner">
175<div id="rainbar"></div>
176<div id="logobar">
177<svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
178<polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
179<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
180</svg>
181<div class="title">
182npm command-line interface
183</div>
184</div>
185</div>
186
187<section id="content">
188<header class="title">
189<h1 id="----npm-install-test----11121">
190 <span>npm-install-test</span>
191 <span class="version">@11.12.1</span>
192</h1>
193<span class="description">Install package(s) and run tests</span>
194</header>
195
196<section id="table_of_contents">
197<h2 id="table-of-contents">Table of contents</h2>
198<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#allow-git"><code>allow-git</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#before"><code>before</code></a></li><li><a href="#min-release-age"><code>min-release-age</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#cpu"><code>cpu</code></a></li><li><a href="#os"><code>os</code></a></li><li><a href="#libc"><code>libc</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
199</section>
200
201<div id="_content"><h3 id="synopsis">Synopsis</h3>
202<pre><code class="language-bash">npm install-test [<package-spec> ...]
203
204alias: it
205</code></pre>
206<h3 id="description">Description</h3>
207<p>This command runs an <code>npm install</code> followed immediately by an <code>npm test</code>.
208It takes exactly the same arguments as <code>npm install</code>.</p>
209<h3 id="configuration">Configuration</h3>
210<h4 id="save"><code>save</code></h4>
211<ul>
212<li>Default: <code>true</code> unless when using <code>npm update</code> where it defaults to <code>false</code></li>
213<li>Type: Boolean</li>
214</ul>
215<p>Save installed packages to a <code>package.json</code> file as dependencies.</p>
216<p>When used with the <code>npm rm</code> command, removes the dependency from
217<code>package.json</code>.</p>
218<p>Will also prevent writing to <code>package-lock.json</code> if set to <code>false</code>.</p>
219<h4 id="save-exact"><code>save-exact</code></h4>
220<ul>
221<li>Default: false</li>
222<li>Type: Boolean</li>
223</ul>
224<p>Dependencies saved to package.json will be configured with an exact version
225rather than using npm's default semver range operator.</p>
226<h4 id="global"><code>global</code></h4>
227<ul>
228<li>Default: false</li>
229<li>Type: Boolean</li>
230</ul>
231<p>Operates in "global" mode, so that packages are installed into the <code>prefix</code>
232folder instead of the current working directory. See
233<a href="../configuring-npm/folders.html">folders</a> for more on the differences in behavior.</p>
234<ul>
235<li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead
236of the current working directory.</li>
237<li>bin files are linked to <code>{prefix}/bin</code></li>
238<li>man pages are linked to <code>{prefix}/share/man</code></li>
239</ul>
240<h4 id="install-strategy"><code>install-strategy</code></h4>
241<ul>
242<li>Default: "hoisted"</li>
243<li>Type: "hoisted", "nested", "shallow", or "linked"</li>
244</ul>
245<p>Sets the strategy for installing packages in node_modules. hoisted
246(default): Install non-duplicated in top-level, and duplicated as necessary
247within directory structure. nested: (formerly --legacy-bundling) install in
248place, no hoisting. shallow (formerly --global-style) only install direct
249deps at top-level. linked: (experimental) install in node_modules/.store,
250link in place, unhoisted.</p>
251<h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
252<ul>
253<li>Default: false</li>
254<li>Type: Boolean</li>
255<li>DEPRECATED: This option has been deprecated in favor of
256<code>--install-strategy=nested</code></li>
257</ul>
258<p>Instead of hoisting package installs in <code>node_modules</code>, install packages in
259the same manner that they are depended on. This may cause very deep
260directory structures and duplicate package installs as there is no
261de-duplicating. Sets <code>--install-strategy=nested</code>.</p>
262<h4 id="global-style"><code>global-style</code></h4>
263<ul>
264<li>Default: false</li>
265<li>Type: Boolean</li>
266<li>DEPRECATED: This option has been deprecated in favor of
267<code>--install-strategy=shallow</code></li>
268</ul>
269<p>Only install direct dependencies in the top level <code>node_modules</code>, but hoist
270on deeper dependencies. Sets <code>--install-strategy=shallow</code>.</p>
271<h4 id="omit"><code>omit</code></h4>
272<ul>
273<li>Default: 'dev' if the <code>NODE_ENV</code> environment variable is set to
274'production'; otherwise, empty.</li>
275<li>Type: "dev", "optional", or "peer" (can be set multiple times)</li>
276</ul>
277<p>Dependency types to omit from the installation tree on disk.</p>
278<p>Note that these dependencies <em>are</em> still resolved and added to the
279<code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> file. They are just not
280physically installed on disk.</p>
281<p>If a package type appears in both the <code>--include</code> and <code>--omit</code> lists, then
282it will be included.</p>
283<p>If the resulting omit list includes <code>'dev'</code>, then the <code>NODE_ENV</code> environment
284variable will be set to <code>'production'</code> for all lifecycle scripts.</p>
285<h4 id="include"><code>include</code></h4>
286<ul>
287<li>Default:</li>
288<li>Type: "prod", "dev", "optional", or "peer" (can be set multiple times)</li>
289</ul>
290<p>Option that allows for defining which types of dependencies to install.</p>
291<p>This is the inverse of <code>--omit=<type></code>.</p>
292<p>Dependency types specified in <code>--include</code> will not be omitted, regardless of
293the order in which omit/include are specified on the command-line.</p>
294<h4 id="strict-peer-deps"><code>strict-peer-deps</code></h4>
295<ul>
296<li>Default: false</li>
297<li>Type: Boolean</li>
298</ul>
299<p>If set to <code>true</code>, and <code>--legacy-peer-deps</code> is not set, then <em>any</em>
300conflicting <code>peerDependencies</code> will be treated as an install failure, even
301if npm could reasonably guess the appropriate resolution based on non-peer
302dependency relationships.</p>
303<p>By default, conflicting <code>peerDependencies</code> deep in the dependency graph will
304be resolved using the nearest non-peer dependency specification, even if
305doing so will result in some packages receiving a peer dependency outside
306the range set in their package's <code>peerDependencies</code> object.</p>
307<p>When such an override is performed, a warning is printed, explaining the
308conflict and the packages involved. If <code>--strict-peer-deps</code> is set, then
309this warning is treated as a failure.</p>
310<h4 id="prefer-dedupe"><code>prefer-dedupe</code></h4>
311<ul>
312<li>Default: false</li>
313<li>Type: Boolean</li>
314</ul>
315<p>Prefer to deduplicate packages if possible, rather than choosing a newer
316version of a dependency.</p>
317<h4 id="package-lock"><code>package-lock</code></h4>
318<ul>
319<li>Default: true</li>
320<li>Type: Boolean</li>
321</ul>
322<p>If set to false, then ignore <code>package-lock.json</code> files when installing. This
323will also prevent <em>writing</em> <code>package-lock.json</code> if <code>save</code> is true.</p>
324<h4 id="package-lock-only"><code>package-lock-only</code></h4>
325<ul>
326<li>Default: false</li>
327<li>Type: Boolean</li>
328</ul>
329<p>If set to true, the current operation will only use the <code>package-lock.json</code>,
330ignoring <code>node_modules</code>.</p>
331<p>For <code>update</code> this means only the <code>package-lock.json</code> will be updated,
332instead of checking <code>node_modules</code> and downloading dependencies.</p>
333<p>For <code>list</code> this means the output will be based on the tree described by the
334<code>package-lock.json</code>, rather than the contents of <code>node_modules</code>.</p>
335<h4 id="foreground-scripts"><code>foreground-scripts</code></h4>
336<ul>
337<li>Default: <code>false</code> unless when using <code>npm pack</code> or <code>npm publish</code> where it
338defaults to <code>true</code></li>
339<li>Type: Boolean</li>
340</ul>
341<p>Run all build scripts (ie, <code>preinstall</code>, <code>install</code>, and <code>postinstall</code>)
342scripts for installed packages in the foreground process, sharing standard
343input, output, and error with the main npm process.</p>
344<p>Note that this will generally make installs run slower, and be much noisier,
345but can be useful for debugging.</p>
346<h4 id="ignore-scripts"><code>ignore-scripts</code></h4>
347<ul>
348<li>Default: false</li>
349<li>Type: Boolean</li>
350</ul>
351<p>If true, npm does not run scripts specified in package.json files.</p>
352<p>Note that commands explicitly intended to run a particular script, such as
353<code>npm start</code>, <code>npm stop</code>, <code>npm restart</code>, <code>npm test</code>, and <code>npm run</code> will still
354run their intended script if <code>ignore-scripts</code> is set, but they will <em>not</em>
355run any pre- or post-scripts.</p>
356<h4 id="allow-git"><code>allow-git</code></h4>
357<ul>
358<li>Default: "all"</li>
359<li>Type: "all", "none", or "root"</li>
360</ul>
361<p>Limits the ability for npm to fetch dependencies from git references. That
362is, dependencies that point to a git repo instead of a version or semver
363range. Please note that this could leave your tree incomplete and some
364packages may not function as intended or designed.</p>
365<p><code>all</code> allows any git dependencies to be fetched and installed. <code>none</code>
366prevents any git dependencies from being fetched and installed. <code>root</code> only
367allows git dependencies defined in your project's package.json to be fetched
368installed. Also allows git dependencies to be fetched for other commands
369like <code>npm view</code></p>
370<h4 id="audit"><code>audit</code></h4>
371<ul>
372<li>Default: true</li>
373<li>Type: Boolean</li>
374</ul>
375<p>When "true" submit audit reports alongside the current npm command to the
376default registry and all registries configured for scopes. See the
377documentation for <a href="../commands/npm-audit.html"><code>npm audit</code></a> for details on what is
378submitted.</p>
379<h4 id="before"><code>before</code></h4>
380<ul>
381<li>Default: null</li>
382<li>Type: null or Date</li>
383</ul>
384<p>If passed to <code>npm install</code>, will rebuild the npm tree such that only
385versions that were available <strong>on or before</strong> the given date are installed.
386If there are no versions available for the current set of dependencies, the
387command will error.</p>
388<p>If the requested version is a <code>dist-tag</code> and the given tag does not pass the
389<code>--before</code> filter, the most recent version less than or equal to that tag
390will be used. For example, <code>foo@latest</code> might install <code>foo@1.2</code> even though
391<code>latest</code> is <code>2.0</code>.</p>
392<p>This config cannot be used with: <code>min-release-age</code></p>
393<h4 id="min-release-age"><code>min-release-age</code></h4>
394<ul>
395<li>Default: null</li>
396<li>Type: null or Number</li>
397</ul>
398<p>If set, npm will build the npm tree such that only versions that were
399available more than the given number of days ago will be installed. If there
400are no versions available for the current set of dependencies, the command
401will error.</p>
402<p>This flag is a complement to <code>before</code>, which accepts an exact date instead
403of a relative number of days.</p>
404<p>This config cannot be used with: <code>before</code></p>
405<p>This value is not exported to the environment for child processes.</p>
406<h4 id="bin-links"><code>bin-links</code></h4>
407<ul>
408<li>Default: true</li>
409<li>Type: Boolean</li>
410</ul>
411<p>Tells npm to create symlinks (or <code>.cmd</code> shims on Windows) for package
412executables.</p>
413<p>Set to false to have it not do this. This can be used to work around the
414fact that some file systems don't support symlinks, even on ostensibly Unix
415systems.</p>
416<h4 id="fund"><code>fund</code></h4>
417<ul>
418<li>Default: true</li>
419<li>Type: Boolean</li>
420</ul>
421<p>When "true" displays the message at the end of each <code>npm install</code>
422acknowledging the number of dependencies looking for funding. See <a href="../commands/npm-fund.html"><code>npm fund</code></a> for details.</p>
423<h4 id="dry-run"><code>dry-run</code></h4>
424<ul>
425<li>Default: false</li>
426<li>Type: Boolean</li>
427</ul>
428<p>Indicates that you don't want npm to make any changes and that it should
429only report what it would have done. This can be passed into any of the
430commands that modify your local installation, eg, <code>install</code>, <code>update</code>,
431<code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.</p>
432<p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>,
433<code>owner</code>, etc.</p>
434<h4 id="cpu"><code>cpu</code></h4>
435<ul>
436<li>Default: null</li>
437<li>Type: null or String</li>
438</ul>
439<p>Override CPU architecture of native modules to install. Acceptable values
440are same as <code>cpu</code> field of package.json, which comes from <code>process.arch</code>.</p>
441<h4 id="os"><code>os</code></h4>
442<ul>
443<li>Default: null</li>
444<li>Type: null or String</li>
445</ul>
446<p>Override OS of native modules to install. Acceptable values are same as <code>os</code>
447field of package.json, which comes from <code>process.platform</code>.</p>
448<h4 id="libc"><code>libc</code></h4>
449<ul>
450<li>Default: null</li>
451<li>Type: null or String</li>
452</ul>
453<p>Override libc of native modules to install. Acceptable values are same as
454<code>libc</code> field of package.json</p>
455<h4 id="workspace"><code>workspace</code></h4>
456<ul>
457<li>Default:</li>
458<li>Type: String (can be set multiple times)</li>
459</ul>
460<p>Enable running a command in the context of the configured workspaces of the
461current project while filtering by running only the workspaces defined by
462this configuration option.</p>
463<p>Valid values for the <code>workspace</code> config are either:</p>
464<ul>
465<li>Workspace names</li>
466<li>Path to a workspace directory</li>
467<li>Path to a parent workspace directory (will result in selecting all
468workspaces within that folder)</li>
469</ul>
470<p>When set for the <code>npm init</code> command, this may be set to the folder of a
471workspace which does not yet exist, to create the folder and set it up as a
472brand new workspace within the project.</p>
473<p>This value is not exported to the environment for child processes.</p>
474<h4 id="workspaces"><code>workspaces</code></h4>
475<ul>
476<li>Default: null</li>
477<li>Type: null or Boolean</li>
478</ul>
479<p>Set to true to run the command in the context of <strong>all</strong> configured
480workspaces.</p>
481<p>Explicitly setting this to false will cause commands like <code>install</code> to
482ignore workspaces altogether. When not set explicitly:</p>
483<ul>
484<li>Commands that operate on the <code>node_modules</code> tree (install, update, etc.)
485will link workspaces into the <code>node_modules</code> folder. - Commands that do
486other things (test, exec, publish, etc.) will operate on the root project,
487<em>unless</em> one or more workspaces are specified in the <code>workspace</code> config.</li>
488</ul>
489<p>This value is not exported to the environment for child processes.</p>
490<h4 id="include-workspace-root"><code>include-workspace-root</code></h4>
491<ul>
492<li>Default: false</li>
493<li>Type: Boolean</li>
494</ul>
495<p>Include the workspace root when workspaces are enabled for a command.</p>
496<p>When false, specifying individual workspaces via the <code>workspace</code> config, or
497all workspaces via the <code>workspaces</code> flag, will cause npm to operate only on
498the specified workspaces, and not on the root project.</p>
499<p>This value is not exported to the environment for child processes.</p>
500<h4 id="install-links"><code>install-links</code></h4>
501<ul>
502<li>Default: false</li>
503<li>Type: Boolean</li>
504</ul>
505<p>When set file: protocol dependencies will be packed and installed as regular
506dependencies instead of creating a symlink. This option has no effect on
507workspaces.</p>
508<h3 id="see-also">See Also</h3>
509<ul>
510<li><a href="../commands/npm-install.html">npm install</a></li>
511<li><a href="../commands/npm-install-ci-test.html">npm install-ci-test</a></li>
512<li><a href="../commands/npm-test.html">npm test</a></li>
513</ul></div>
514
515<footer id="edit">
516<a href="https://github.com/npm/cli/edit/latest/docs/lib/content/commands/npm-install-test.md">
517<svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
518<path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
519</svg>
520Edit this page on GitHub
521</a>
522</footer>
523</section>
524
525
526
527</body></html>