1 ---
2 title: npm-ci
3 section: 1
4 description: Install a project with a clean slate
5 github_repo: npm/cli
6 github_branch: release/v7
7 github_path: docs/content/commands/npm-ci.md
8 redirect_from:
9 - /cli-documentation/v7/ci
10 - /cli-documentation/v7/cli-commands/ci
11 - /cli-documentation/v7/cli-commands/npm-ci
12 - /cli-documentation/v7/commands/ci
13 - /cli-documentation/v7/commands/npm-ci
14 - /cli-documentation/v7/npm-ci
15 - /cli/v7/ci
16 - /cli/v7/cli-commands/ci
17 - /cli/v7/cli-commands/npm-ci
18 - /cli/v7/commands/ci
19 - /cli/v7/npm-ci
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm ci
26 ```
27
28 ### Description
29
30 This command is similar to [`npm install`](/cli/v7/commands/npm-install), except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies.
31
32 `npm ci` will be significantly faster when:
33
34 - There is a `package-lock.json` or `npm-shrinkwrap.json` file.
35 - The `node_modules` folder is missing or empty.
36
37 In short, the main differences between using `npm install` and `npm ci` are:
38
39 - The project **must** have an existing `package-lock.json` or `npm-shrinkwrap.json`.
40 - If dependencies in the package lock do not match those in `package.json`, `npm ci` will exit with an error, instead of updating the package lock.
41 - `npm ci` can only install entire projects at a time: individual dependencies cannot be added with this command.
42 - If a `node_modules` is already present, it will be automatically removed before `npm ci` begins its install.
43 - It will never write to `package.json` or any of the package-locks: installs are essentially frozen.
44
45 ### Example
46
47 Make sure you have a package-lock and an up-to-date install:
48
49 ```bash
50 $ cd ./my/npm/project
51 $ npm install
52 added 154 packages in 10s
53 $ ls | grep package-lock
54 ```
55
56 Run `npm ci` in that project
57
58 ```bash
59 $ npm ci
60 added 154 packages in 5s
61 ```
62
63 Configure Travis to build using `npm ci` instead of `npm install`:
64
65 ```bash
66 # .travis.yml
67 install:
68 - npm ci
69 # keep the npm cache around to speed up installs
70 cache:
71 directories:
72 - "$HOME/.npm"
73 ```
74
75 ### Configuration
76
77 #### `audit`
78
79 - Default: true
80 - Type: Boolean
81
82 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.
83
84 #### `ignore-scripts`
85
86 - Default: false
87 - Type: Boolean
88
89 If true, npm does not run scripts specified in package.json files.
90
91 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.
92
93 #### `script-shell`
94
95 - Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
96 - Type: null or String
97
98 The shell to use for scripts run with the `npm exec`, `npm run` and `npm init <pkg>` commands.
99
100 ### See Also
101
102 - [npm install](/cli/v7/commands/npm-install)
103 - [package-lock.json](/cli/v7/configuring-npm/package-lock-json)