Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parameter for devs to choose between npm install and npm ci #56

Open
mikaelkundert opened this issue Oct 29, 2019 · 2 comments
Open

Comments

@mikaelkundert
Copy link

Problem

Using npm install we get slower installation and potential differences between installations (that was surprise to me too, even after introducing package-lock.json).

Currently we have one job that uses npm install, that's npm-install-build -job in https://github.com/wunderio/silta-circleci/blob/master/orb.yml#L350.

In our projects we've recently moved to use npm ci and we have this orb's job to run frontend building and hence this is the only one left that still uses npm install.

Suggested solution

Using npm ci could be better approach, but changing to that would exclude cases that still wants to stick with npm install for some cases.

Giving devs an option to specify wether to prefer npm install or npm ci would be great.

Read more about npm ci: https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable

@floretan
Copy link
Contributor

The problem with npm ci is that it always downloads all dependencies. npm install might be slower on the initial build, but afterwards it's pretty much instantaneous since it keeps existing dependencies.

Also, if we use npm ci, we should bypass the CircleCI caching, as it would be useless.

@henrijs
Copy link

henrijs commented Jan 17, 2024

Bump for this one, npm ci should be default for security reasons too, imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants