Why "npm ci" removes node_modules / all packages?

1.5k Views Asked by At

Why npm ci removes the node_modules / all packages?

If a node_modules is already present, it will be automatically removed before npm ci begins its install.

1

There are 1 best solutions below

3
Karel Bílek On

To make sure you are always in the correct state, even if you, or someone else (meaning, some other tool or such), somehow fiddled with node_modules.

It tries to get to a state as if you just installed the module from zero.