I have a problem while installing package using npm
it is decreasing dependencies versions that breaks my application and unit tests, for example my package.lock
file fater instalation looks like:
Please tell me how can I install package without decreasing dependencies versions ?
Asked
Active
Viewed 109 times
3

Uladz Kha
- 2,154
- 4
- 40
- 61
-
1related: https://stackoverflow.com/questions/52499617/what-is-the-difference-between-npm-install-and-npm-ci/53325242#53325242 – Puka Jan 06 '22 at 08:02
1 Answers
2
You could try to use npm ci
:
In short, the main differences between using npm install and npm ci are:
- The project must have an existing package-lock.json or npm-shrinkwrap.json.
- If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of updating the package lock.
- npm ci can only install entire projects at a time: individual dependencies cannot be added with this command.
- If a node_modules is already present, it will be automatically removed before npm ci begins its install.
- It will never write to package.json or any of the package-locks: installs are essentially frozen.

Puka
- 1,485
- 1
- 14
- 33