Answer the question
In order to leave comments, you need to log in
Is it correct to always use npm ci instead of npm install?
Hello.
The same situation periodically arises: I add the library on my PC via npm, then upload the code to the server. Since node_modules is in .gitignore, you have to run npm install on the server, which modifies package-lock.json and the next time you commit, there will be a conflict with this file on the server.
If you run npm ci instead of npm install, then there are no problems. Also, npm ci is an exact copy of your local project, while npm install is not.
Is it correct to always use npm ci on the server?
Answer the question
In order to leave comments, you need to log in
The server is definitely correct.
https://docs.npmjs.com/cli/ci.html
Moreover, I also use it in development, except when I need to explicitly update something.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question