ci: set install-links to false when using npm ci #201
Merged
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.
This fixes the failing build and tests when the github action runs
npm ci
.It seems that there is a change between the
package-lock.json
files when runningnpm install
with--install-links=true
vs--install-links=false
. Npm version>=9.0.0
and<9.4.2
has--install-links=true
, whereas other versions do not. The version of node used in our CI build is18.14.0
, which comes with npm9.3.1
, causing the build to fail when thepackage-lock.json
is not generated with a compatible npm version. This was unintentionally a breaking change so--install-links
was reverted back tofalse
in npm9.4.2
, see nodejs/node#46542 and npm/cli#6142.This is also related to #176 - because of the way our project is setup, it needs
--install-links=false
, otherwise this issue occurs. I think this is because--install-links=true
packs and builds afile:
dependency like it would a regular dependency, rather than symlinking it and there is no build step inelsa-types
orelsa-constants
that transpiles the typescript, so this issue occurs. It might worth thinking about how to setupelsa-types
andelsa-constants
so that it works with--install-links=true
, because newer versions of npm could have this as the default again. One way to do this is with atsc --build
script and exporting the correct parts ofelsa-types
andelsa-constants
.TL;DR
>=9.0.0
and<9.4.2
, runnpm install
with--install-links=false
, or use an npm version where--install-links=false
by default, such as npm9.4.2
.