1 ---
2 title: npm-install-test
3 section: 1
4 description: Install package(s) and run tests
5 github_repo: npm/cli
6 github_branch: release/v7
7 github_path: docs/content/commands/npm-install-test.md
8 redirect_from:
9 - /cli-documentation/v7/cli-commands/install-test
10 - /cli-documentation/v7/cli-commands/npm-install-test
11 - /cli-documentation/v7/commands/install-test
12 - /cli-documentation/v7/commands/npm-install-test
13 - /cli-documentation/v7/install-test
14 - /cli-documentation/v7/npm-install-test
15 - /cli/v7/cli-commands/install-test
16 - /cli/v7/cli-commands/npm-install-test
17 - /cli/v7/commands/install-test
18 - /cli/v7/install-test
19 - /cli/v7/npm-install-test
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm install-test (with no args, in package dir)
26 npm install-test [<@scope>/]<name>
27 npm install-test [<@scope>/]<name>@<tag>
28 npm install-test [<@scope>/]<name>@<version>
29 npm install-test [<@scope>/]<name>@<version range>
30 npm install-test <tarball file>
31 npm install-test <tarball url>
32 npm install-test <folder>
33
34 alias: npm it
35 common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run]
36 ```
37
38 ### Description
39
40 This command runs an `npm install` followed immediately by an `npm test`. It takes exactly the same arguments as `npm install`.
41
42 ### Configuration
43
44 #### `save`
45
46 - Default: true
47 - Type: Boolean
48
49 Save installed packages to a package.json file as dependencies.
50
51 When used with the `npm rm` command, removes the dependency from package.json.
52
53 #### `save-exact`
54
55 - Default: false
56 - Type: Boolean
57
58 Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator.
59
60 #### `global`
61
62 - Default: false
63 - Type: Boolean
64
65 Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See [folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
66
67 - packages are installed into the `{prefix}/lib/node_modules` folder, instead of the current working directory.
68 - bin files are linked to `{prefix}/bin`
69 - man pages are linked to `{prefix}/share/man`
70
71 #### `global-style`
72
73 - Default: false
74 - Type: Boolean
75
76 Causes npm to install the package into your local `node_modules` folder with the same layout it uses with the global `node_modules` folder. Only your direct dependencies will show in `node_modules` and everything they depend on will be flattened in their `node_modules` folders. This obviously will eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` will be preferred.
77
78 #### `legacy-bundling`
79
80 - Default: false
81 - Type: Boolean
82
83 Causes npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, can install the package. This eliminates all automatic deduping. If used with `global-style` this option will be preferred.
84
85 #### `strict-peer-deps`
86
87 - Default: false
88 - Type: Boolean
89
90 If set to `true`, and `--legacy-peer-deps` is not set, then _any_ conflicting `peerDependencies` will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships.
91
92 By default, conflicting `peerDependencies` 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 `peerDependencies` object.
93
94 When such and override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure.
95
96 #### `package-lock`
97
98 - Default: true
99 - Type: Boolean
100
101 If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true.
102
103 When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`.
104
105 #### `omit`
106
107 - Default: 'dev' if the `NODE_ENV` environment variable is set to 'production', otherwise empty.
108 - Type: "dev", "optional", or "peer" (can be set multiple times)
109
110 Dependency types to omit from the installation tree on disk.
111
112 Note that these dependencies _are_ still resolved and added to the `package-lock.json` or `npm-shrinkwrap.json` file. They are just not physically installed on disk.
113
114 If a package type appears in both the `--include` and `--omit` lists, then it will be included.
115
116 If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts.
117
118 #### `ignore-scripts`
119
120 - Default: false
121 - Type: Boolean
122
123 If true, npm does not run scripts specified in package.json files.
124
125 Note that commands explicitly intended to run a particular script, such as `npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` will still run their intended script if `ignore-scripts` is set, but they will _not_ run any pre- or post-scripts.
126
127 #### `audit`
128
129 - Default: true
130 - Type: Boolean
131
132 When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v7/commands/npm-audit) for details on what is submitted.
133
134 #### `bin-links`
135
136 - Default: true
137 - Type: Boolean
138
139 Tells npm to create symlinks (or `.cmd` shims on Windows) for package executables.
140
141 Set 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.
142
143 #### `fund`
144
145 - Default: true
146 - Type: Boolean
147
148 When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v7/commands/npm-fund) for details.
149
150 #### `dry-run`
151
152 - Default: false
153 - Type: Boolean
154
155 Indicates 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, `install`, `update`, `dedupe`, `uninstall`, as well as `pack` and `publish`.
156
157 Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc.
158
159 #### `workspace`
160
161 - Default:
162 - Type: String (can be set multiple times)
163
164 Enable 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.
165
166 Valid values for the `workspace` config are either:
167
168 - Workspace names
169 - Path to a workspace directory
170 - Path to a parent workspace directory (will result to selecting all of the nested workspaces)
171
172 When set for the `npm init` 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.
173
174 This value is not exported to the environment for child processes.
175
176 #### `workspaces`
177
178 - Default: false
179 - Type: Boolean
180
181 Enable running a command in the context of **all** the configured workspaces.
182
183 This value is not exported to the environment for child processes.
184
185 ### See Also
186
187 - [npm install](/cli/v7/commands/npm-install)
188 - [npm install-ci-test](/cli/v7/commands/npm-install-ci-test)
189 - [npm test](/cli/v7/commands/npm-test)