Incremental `npm ci`

Currently npm ci deletes node_modules/ . It would be great if it supports incremental update.

To understand the idea, if you want incremental updates, why would you use npm ci rather than npm install?

The current intended usage is:

any situation where you want to make sure you’re doing a clean install of your dependencies

https://docs.npmjs.com/cli/ci.html

Here is one example usage:

  1. User is working on a shared project.
  2. User just pulled the latest changes from “master” branch, which includes the npm lock file.
  3. User wants to make sure the dependencies are up to date so runs npm ci.

To my understanding, even if there is no change or only one package change, it will install everything from scratch currently.

We’re using yarn currently and was debating if we can switch back, and this was the only major difference for our workflow. yarn install --frozen-lockfile does incremental updates. Also mentioned from another comment here https://www.reddit.com/r/javascript/comments/ad6zoj/npm_vs_yarn_which_one_and_why/em7puzp?utm_source=share&utm_medium=web2x

1 Like