codekingpro/portable-devtools
114k
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` will still
140run their intended script if `ignore-scripts` is set, but they will *not*
141run any pre- or post-scripts.
142
143
144
145#### `allow-git`
146
147* Default: "all"
148* Type: "all", "none", or "root"
149
150Limits the ability for npm to fetch dependencies from git references. That
151is, dependencies that point to a git repo instead of a version or semver
152range. Please note that this could leave your tree incomplete and some
153packages may not function as intended or designed.
154
155`all` allows any git dependencies to be fetched and installed. `none`
156prevents any git dependencies from being fetched and installed. `root` only
157allows git dependencies defined in your project's package.json to be fetched
158installed. Also allows git dependencies to be fetched for other commands
159like `npm view`
160
161
162
163#### `audit`
164
165* Default: true
166* Type: Boolean
167
168When "true" submit audit reports alongside the current npm command to the
169default registry and all registries configured for scopes. See the
170documentation for [`npm audit`](/commands/npm-audit) for details on what is
171submitted.
172
173
174
175#### `bin-links`
176
177* Default: true
178* Type: Boolean
179
180Tells npm to create symlinks (or `.cmd` shims on Windows) for package
181executables.
182
183Set to false to have it not do this. This can be used to work around the
184fact that some file systems don't support symlinks, even on ostensibly Unix
185systems.
186
187
188
189#### `fund`
190
191* Default: true
192* Type: Boolean
193
194When "true" displays the message at the end of each `npm install`
195acknowledging the number of dependencies looking for funding. See [`npm
196fund`](/commands/npm-fund) for details.
197
198
199
200#### `dry-run`
201
202* Default: false
203* Type: Boolean
204
205Indicates that you don't want npm to make any changes and that it should
206only report what it would have done. This can be passed into any of the
207commands that modify your local installation, eg, `install`, `update`,
208`dedupe`, `uninstall`, as well as `pack` and `publish`.
209
210Note: This is NOT honored by other network related commands, eg `dist-tags`,
211`owner`, etc.
212
213
214
215#### `workspace`
216
217* Default:
218* Type: String (can be set multiple times)
219
220Enable running a command in the context of the configured workspaces of the
221current project while filtering by running only the workspaces defined by
222this configuration option.
223
224Valid values for the `workspace` config are either:
225
226* Workspace names
227* Path to a workspace directory
228* Path to a parent workspace directory (will result in selecting all
229 workspaces within that folder)
230
231When set for the `npm init` command, this may be set to the folder of a
232workspace which does not yet exist, to create the folder and set it up as a
233brand new workspace within the project.
234
235This value is not exported to the environment for child processes.
236
237#### `workspaces`
238
239* Default: null
240* Type: null or Boolean
241
242Set to true to run the command in the context of **all** configured
243workspaces.
244
245Explicitly setting this to false will cause commands like `install` to
246ignore workspaces altogether. When not set explicitly:
247
248- Commands that operate on the `node_modules` tree (install, update, etc.)
249will link workspaces into the `node_modules` folder. - Commands that do
250other things (test, exec, publish, etc.) will operate on the root project,
251_unless_ one or more workspaces are specified in the `workspace` config.
252
253This value is not exported to the environment for child processes.
254
255#### `include-workspace-root`
256
257* Default: false
258* Type: Boolean
259
260Include the workspace root when workspaces are enabled for a command.
261
262When false, specifying individual workspaces via the `workspace` config, or
263all workspaces via the `workspaces` flag, will cause npm to operate only on
264the specified workspaces, and not on the root project.
265
266This value is not exported to the environment for child processes.
267
268#### `install-links`
269
270* Default: false
271* Type: Boolean
272
273When set file: protocol dependencies will be packed and installed as regular
274dependencies instead of creating a symlink. This option has no effect on
275workspaces.
276
277
278
279### See Also
280
281* [npm install-test](/commands/npm-install-test)
282* [npm ci](/commands/npm-ci)
283* [npm test](/commands/npm-test)
284 