1---
2title: npm-install-ci-test
3section: 1
4description: Install a project with a clean slate and run tests
5---
6
7### Synopsis
8
9```bash
10npm install-ci-test
11
12aliases: cit, clean-install-test, sit
13```
14
15### Description
16
17This command runs `npm ci` followed immediately by `npm test`.
18
19### Configuration
20
21#### `install-strategy`
22
23* Default: "hoisted"
24* Type: "hoisted", "nested", "shallow", or "linked"
25
26Sets the strategy for installing packages in node_modules. hoisted
27(default): Install non-duplicated in top-level, and duplicated as necessary
28within directory structure. nested: (formerly --legacy-bundling) install in
29place, no hoisting. shallow (formerly --global-style) only install direct
30deps at top-level. linked: (experimental) install in node_modules/.store,
31link in place, unhoisted.
32
33
34
35#### `legacy-bundling`
36
37* Default: false
38* Type: Boolean
39* DEPRECATED: This option has been deprecated in favor of
40  `--install-strategy=nested`
41
42Instead of hoisting package installs in `node_modules`, install packages in
43the same manner that they are depended on. This may cause very deep
44directory structures and duplicate package installs as there is no
45de-duplicating. Sets `--install-strategy=nested`.
46
47
48
49#### `global-style`
50
51* Default: false
52* Type: Boolean
53* DEPRECATED: This option has been deprecated in favor of
54  `--install-strategy=shallow`
55
56Only install direct dependencies in the top level `node_modules`, but hoist
57on deeper dependencies. Sets `--install-strategy=shallow`.
58
59
60
61#### `omit`
62
63* Default: 'dev' if the `NODE_ENV` environment variable is set to
64  'production', otherwise empty.
65* Type: "dev", "optional", or "peer" (can be set multiple times)
66
67Dependency types to omit from the installation tree on disk.
68
69Note that these dependencies _are_ still resolved and added to the
70`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
71physically installed on disk.
72
73If a package type appears in both the `--include` and `--omit` lists, then
74it will be included.
75
76If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
77variable will be set to `'production'` for all lifecycle scripts.
78
79
80
81#### `include`
82
83* Default:
84* Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
85
86Option that allows for defining which types of dependencies to install.
87
88This is the inverse of `--omit=<type>`.
89
90Dependency types specified in `--include` will not be omitted, regardless of
91the order in which omit/include are specified on the command-line.
92
93
94
95#### `strict-peer-deps`
96
97* Default: false
98* Type: Boolean
99
100If set to `true`, and `--legacy-peer-deps` is not set, then _any_
101conflicting `peerDependencies` will be treated as an install failure, even
102if npm could reasonably guess the appropriate resolution based on non-peer
103dependency relationships.
104
105By default, conflicting `peerDependencies` deep in the dependency graph will
106be resolved using the nearest non-peer dependency specification, even if
107doing so will result in some packages receiving a peer dependency outside
108the range set in their package's `peerDependencies` object.
109
110When such an override is performed, a warning is printed, explaining the
111conflict and the packages involved. If `--strict-peer-deps` is set, then
112this warning is treated as a failure.
113
114
115
116#### `foreground-scripts`
117
118* Default: `false` unless when using `npm pack` or `npm publish` where it
119  defaults to `true`
120* Type: Boolean
121
122Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
123scripts for installed packages in the foreground process, sharing standard
124input, output, and error with the main npm process.
125
126Note that this will generally make installs run slower, and be much noisier,
127but can be useful for debugging.
128
129
130
131#### `ignore-scripts`
132
133* Default: false
134* Type: Boolean
135
136If true, npm does not run scripts specified in package.json files.
137
138Note that commands explicitly intended to run a particular script, such as
139`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
140will still run their intended script if `ignore-scripts` is set, but they
141will *not* run any pre- or post-scripts.
142
143
144
145#### `audit`
146
147* Default: true
148* Type: Boolean
149
150When "true" submit audit reports alongside the current npm command to the
151default registry and all registries configured for scopes. See the
152documentation for [`npm audit`](/commands/npm-audit) for details on what is
153submitted.
154
155
156
157#### `bin-links`
158
159* Default: true
160* Type: Boolean
161
162Tells npm to create symlinks (or `.cmd` shims on Windows) for package
163executables.
164
165Set to false to have it not do this. This can be used to work around the
166fact that some file systems don't support symlinks, even on ostensibly Unix
167systems.
168
169
170
171#### `fund`
172
173* Default: true
174* Type: Boolean
175
176When "true" displays the message at the end of each `npm install`
177acknowledging the number of dependencies looking for funding. See [`npm
178fund`](/commands/npm-fund) for details.
179
180
181
182#### `dry-run`
183
184* Default: false
185* Type: Boolean
186
187Indicates that you don't want npm to make any changes and that it should
188only report what it would have done. This can be passed into any of the
189commands that modify your local installation, eg, `install`, `update`,
190`dedupe`, `uninstall`, as well as `pack` and `publish`.
191
192Note: This is NOT honored by other network related commands, eg `dist-tags`,
193`owner`, etc.
194
195
196
197#### `workspace`
198
199* Default:
200* Type: String (can be set multiple times)
201
202Enable running a command in the context of the configured workspaces of the
203current project while filtering by running only the workspaces defined by
204this configuration option.
205
206Valid values for the `workspace` config are either:
207
208* Workspace names
209* Path to a workspace directory
210* Path to a parent workspace directory (will result in selecting all
211  workspaces within that folder)
212
213When set for the `npm init` command, this may be set to the folder of a
214workspace which does not yet exist, to create the folder and set it up as a
215brand new workspace within the project.
216
217This value is not exported to the environment for child processes.
218
219#### `workspaces`
220
221* Default: null
222* Type: null or Boolean
223
224Set to true to run the command in the context of **all** configured
225workspaces.
226
227Explicitly setting this to false will cause commands like `install` to
228ignore workspaces altogether. When not set explicitly:
229
230- Commands that operate on the `node_modules` tree (install, update, etc.)
231will link workspaces into the `node_modules` folder. - Commands that do
232other things (test, exec, publish, etc.) will operate on the root project,
233_unless_ one or more workspaces are specified in the `workspace` config.
234
235This value is not exported to the environment for child processes.
236
237#### `include-workspace-root`
238
239* Default: false
240* Type: Boolean
241
242Include the workspace root when workspaces are enabled for a command.
243
244When false, specifying individual workspaces via the `workspace` config, or
245all workspaces via the `workspaces` flag, will cause npm to operate only on
246the specified workspaces, and not on the root project.
247
248This value is not exported to the environment for child processes.
249
250#### `install-links`
251
252* Default: false
253* Type: Boolean
254
255When set file: protocol dependencies will be packed and installed as regular
256dependencies instead of creating a symlink. This option has no effect on
257workspaces.
258
259
260
261### See Also
262
263* [npm install-test](/commands/npm-install-test)
264* [npm ci](/commands/npm-ci)
265* [npm test](/commands/npm-test)
266