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

ci: set install-links to false when using npm ci #201

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

mmalenic
Copy link
Contributor

@mmalenic mmalenic commented Feb 13, 2023

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 running npm 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 is 18.14.0, which comes with npm 9.3.1, causing the build to fail when the package-lock.json is not generated with a compatible npm version. This was unintentionally a breaking change so --install-links was reverted back to false in npm 9.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 a file: dependency like it would a regular dependency, rather than symlinking it and there is no build step in elsa-types or elsa-constants that transpiles the typescript, so this issue occurs. It might worth thinking about how to setup elsa-types and elsa-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 a tsc --build script and exporting the correct parts of elsa-types and elsa-constants.

TL;DR

  • If you are using npm version >=9.0.0 and <9.4.2, run npm install with --install-links=false, or use an npm version where --install-links=false by default, such as npm 9.4.2.

@mmalenic mmalenic merged commit 846fce9 into dev Feb 24, 2023
@mmalenic mmalenic deleted the regenerate-package-lock branch February 24, 2023 02:36
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

Successfully merging this pull request may close these issues.

4 participants