npm ci

169 阅读1分钟

npm ci

docs.npmjs.com/cli/ci

what

npm ci bypasses a package’s package.json to install modules from a package’s lockfile. This ensures reproducible builds—you are getting exactly what you expect on every install.Previously, developers who wanted to ensure that node_modules/ and package.json stayed in sync would have to archive their node_modules folder. npm ci replaces this process with a single command.

why

npm ci is fast—in some cases, twice as fast as using npm i, representing a significant performance improvement for all developers using continuous integration.This added speed and reliability reduces wasted time and promotes best practices. If it’s faster and easier to run tests, developers run them more often and catch errors sooner.npm ci promises the most benefit to large teams. Giving developers the ability to “sign off” on a package lock promotes more efficient collaboration across large...