Man page - npm-ci(1)
Packages contains this manual
- npm-root(1)
- npm-explain(1)
- npm-whoami(1)
- npm-pack(1)
- npm-bugs(1)
- npm-view(1)
- npm-outdated(1)
- npm-update(1)
- npm-query(1)
- npm-logout(1)
- npm-deprecate(1)
- npm-exec(1)
- npm-ping(1)
- npm-shrinkwrap-json(5)
- npm-help(1)
- npm-prefix(1)
- npm-diff(1)
- npm-owner(1)
- npm-install(1)
- npmrc(5)
- npm-uninstall(1)
- npm-hook(1)
- npm-unstar(1)
- npm-docs(1)
- pacote(1)
- npm-restart(1)
- npm-star(1)
- npm-link(1)
- npm-test(1)
- npm-token(1)
- npm-arborist(1)
- npm-profile(1)
- npm-team(1)
- npx(1)
- npm-stars(1)
- npm-adduser(1)
- npm-cache(1)
- npm-edit(1)
- npm-doctor(1)
- npm-help-search(1)
- arborist(1)
- npm-rebuild(1)
- npm-repo(1)
- npm-publish(1)
- npm-start(1)
- npm-unpublish(1)
- npm-dedupe(1)
- npm-init(1)
- npm-dist-tag(1)
- npm-login(1)
- npm-config(1)
- npm(1)
- npm-search(1)
- npm-version(1)
- npm-org(1)
- npm-shrinkwrap(1)
- npm-ls(1)
- package-json(5)
- npm-stop(1)
- npm-install-test(1)
- npm-completion(1)
- npm-run-script(1)
- npm-prune(1)
- npm-access(1)
- npm-ci(1)
- npm-audit(1)
- npm-find-dupes(1)
- npm-install-ci-test(1)
- package-lock-json(5)
- npm-fund(1)
- npm-explore(1)
- npm-pkg(1)
- node-pacote
- node-npmcli-mock-registry
- node-npmcli-node-gyp
- node-libnpmorg
- npm
- node-libnpmteam
- node-npmcli-promise-spawn
- node-libnpmdiff
- node-npmcli-run-script
- node-npmcli-metavuln-calculator
- node-npmcli-smoke-tests
- node-libnpmpublish
- node-qrcode-terminal
- node-npmcli-config
- node-npmcli-git
- node-libnpmaccess
- node-npm-packlist
- node-npmcli-disparity-colors
- node-libnpmexec
- node-npmcli-installed-package-contents
- node-libnpmpack
- node-npmcli-map-workspaces
- node-npmcli-query
- node-npmcli-arborist
- node-npmcli-package-json
- node-libnpmhook
- node-npmcli-name-from-folder
- node-libnpmversion
- node-libnpmfund
- node-libnpmsearch
apt-get install npm
Manual
NPM-CI
NAMESynopsis
Description
Example
Configuration
See Also
NAME
npm-ci
Synopsis
<!-- AUTOGENERATED USAGE DESCRIPTIONS -->
Description
This command is
similar to
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.
The main differences between using npm install and npm ci are:
|
β’ |
The project must have an existing package-lock.json or |
npm-shrinkwrap.json .
|
β’ |
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.
|
β’ |
npm ci can only install entire projects at a time: individual |
dependencies cannot be added with this command.
|
β’ |
If a node_modules is already present, it will be automatically removed |
before npm ci begins its install.
|
β’ |
It will never write to package.json or any of the package-locks: |
installs are essentially frozen.
NOTE: If you
create your
package-lock.json
file by running
npm
install
with flags that can affect the shape of your dependency
tree, such as
--legacy-peer-deps
or
--install-links
, you
must
provide the same
flags to
npm ci
or you are likely to encounter
errors. An easy way to do
this is to run, for example,
npm config set legacy-peer-deps=true --location=project
and commit the
.npmrc
file to your repo.
Example
Make sure you have a package-lock and an up-to-date install:
$ cd ./my/npm/project
$ npm install
added 154 packages in 10s
$ ls | grep package-lock
Run npm ci in that project
$ npm ci
added 154 packages in 5s
Configure Travis CI to build using npm ci instead of npm install :
# .travis.yml
install:
- npm ci
# keep the npm cache around to speed up installs
cache:
directories:
- "$HOME/.npm"
Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS -->
See Also
|
β’ |
npm install |
|||
|
β’ |
package-lock.json |