Read the statement by Michael Teeuw here.
`npm ci` instead of `npm install`
-
many developer don’t know what is package.json file
Isn’t that one of the first things you learn when you start using npm? :-)
this command need package-lock.json
Yes, of course. And the core system has the
package-lock.json
. I was not talking about modules. Sorry if that was not clear. -
@kristjanesperanto said in `npm ci` instead of `npm install`:
Isn’t that one of the first things you learn when you start using npm?
no. I hadn’t heard about packages on til at least a year after I had written my first module.
-
I used
npm ci
for a while. Because thepackage-lock.json
format changed meanwhile I had problems withnpm ci --no-optional
with node 14, so I switched back tonpm install
.But main point is you don’t get needed updates, e.g. we had in October an electron update because of invalid certs, in this case you had to use
npm install
.As this is no direct part of the code we could update the documentation and explain both variants but I would prefer
npm install
as the default variant. Everyone who knows the difference can use what he wants. -
@karsten13 I use npm install in the installer and updater for all these reasons
-
yes, and AFAIK you are using
npm install --only=prod
. This is may a thing to be mentioned in the docs because 99% of the users don’t need the dev dependencies … -
@karsten13 right
but that is not ci
-
Okay, thanks for your opinions. I’ll use
npm ci
for a while with my instances to gain more experience.I mark this thread as solved for now. Further opinions are of course welcome.