|
|
|
|
|
by hiccuphippo
201 days ago
|
|
Also badly named commands, `npm install` updates your packages to the latest version allowed by package.json and updates the lock file, `npm ci` is what people usually want to do: install the versions according to the lock file. IMO, `ci` should be `install`, `install` should be `update`. Plus the install command is reused to add dependencies, that should be a separate command. |
|
`npm install` will always use the versions listed in package-lock.json unless your package.json has been edited to list newer versions than are present in package-lock.json.
The only difference with `npm ci` is that `npm ci` fails if the two are out of sync (and it deletes `node_modules` first).