This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
npm install
is somewhat meant for interactive runs. Here are some reasons to avoid it:npm ci
is meant for automated deployments and does not suffer from the same issues. Instead, it manages its own cache (#511) and ensures a deterministic result.It still is slower than an npm install under ideal conditions, but it might be less of a concern than previously expected. With the npm cache (#511), an npm ci on a mid-size project on a laptop takes 7-8s for me as opposed to 2-3s for npm install. The command also runs offline, retrieving all packages from the cache.
This PR might be breaking for some user-provided NPM_FLAGS. As npm ci does not take any options, we may be disabling some functionality users expected. An overview of the existing npm install options brings these, probably unlikely, cases:
--dry-run
and package-lock.json will suddenly have their dependencies installed. Assuming they also install their dependencies themselves in a separate step, this will not impact their build success, but will slow it down by adding duplicate effort;--no-package-lock
will get older versions of dependencies than they expect, likely breaking their builds;--omit
will get more dependencies than they expect, probably not impacting their build success, but slowing it down;--ignore-scripts
may have their builds slow down or possibly break.Closes #113, #114, #165, #172, #509, #510, #511.