DEV Community

Prashant Andani
Prashant Andani

Posted on

2 1

Difference between npm install and npm ci

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.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay