W
W
WebDev2019-10-10 11:48:59
JavaScript
WebDev, 2019-10-10 11:48:59

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

1 answer(s)
L
Lynn "Coffee Man", 2019-10-10
@kirill-93

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 question

Ask a Question

731 491 924 answers to any question