Introducing "npm ci" for faster and more reliable builds

Original author: Blog about npm things
  • Transfer
From today, all npm users can take advantage of a new installation command called “npm ci”. The team provides massive improvements in assembly performance and reliability for continuous integration and continuous deployment processes, providing consistent and quick experience for developers using CI / CD in their work.

What kind of tops is this?


npm ci ignores package.json of the package and installs the modules according to the locfile (package-lock.json). This allows you to create reproducible assemblies: you get exactly what you expect with each installation.

Previously, developers who wanted synchronized node_mobules and package.json archived their node_modules folder. npm ci replaces this process with a single command.

Why?


It is fast.





npm ci is fast - in some cases, twice as fast as npm i. It provides a significant increase in productivity for all developers using continuous integration.

These increased speed and reliability reduce time and contribute to best development practices. It is faster and easier to run tests; developers can run them more often and more actively catch errors.

npm ci promises that the biggest advantage will be given to large teams. The ability to let developers “subscribe” to a lock file contributes to more efficient collaboration in large teams, and the ability to install exactly what is described in the lock file can potentially save tens, if not thousands, of working hours per month, allowing teams to spend more of their time to create and support beautiful things.

It increases reliability.


npm ci also provides additional options for improving the reliability of your application builds. As an additional installation command, npm ci can be used to return to its original state if npm i failed, and vice versa. This greatly reduces the likelihood of an unsuccessful installation.

How?


npm ci is available immediately after upgrading to the latest version of npm: run npm install -g npm @ latest. Used for about lshih details about the release, refer to the ravine changes .

What do you think?


We want to know how this works for you as well. Questions? Results? Want to share what you and your team have created? Write to us .

Only registered users can participate in the survey. Please come in.

Which package manager do you use most often in your projects?

  • 74.3% npm 154
  • 25.1% yarn 52
  • 0.4% pnpm 1

Also popular now: