-
Notifications
You must be signed in to change notification settings - Fork 167
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
Automatically installing NodeJS/NPM is not working on Alpine Linux/musl #13837
Comments
Looks like the problem is roughly located here: flow/flow-server/src/main/java/com/vaadin/flow/server/frontend/installer/Platform.java Lines 131 to 140 in 3f783a7
This class was likely copy pasted from https://github.com/eirslett/frontend-maven-plugin but never updated because this PR is missing: eirslett/frontend-maven-plugin#934 Here the fixed piece of code from the |
Thanks @AB-xdev for reporting this issue and making a deep investigation of the root cause and solution. |
Sorry, but I currently have no capacity to fix this. Would be best if someone else could do it :) |
musl is Experimental so using the experimental download root Fixes #13837
* fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com>
* fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com>
* fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com>
* fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com>
@AB-xdev the patch for this issue should be available in next Vaadin releases (preliminary in Vaadin 23.1.7, Vaadin 14.8.16). Please test it on your side and let us know if you still have an issues with Node/NPM auto installations by commenting on this ticket or by creating a new one. |
* fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com>
* fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com>
#14349) * fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com> Co-authored-by: caalador <mikael.grankvist@vaadin.com> Co-authored-by: taefi <taefi.soroosh@gmail.com>
#14350) * fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com> Co-authored-by: caalador <mikael.grankvist@vaadin.com> Co-authored-by: taefi <taefi.soroosh@gmail.com>
#14348) * fix: Support Alpine by detecting OS using /etc/alpine-release musl is Experimental so using the experimental download root Fixes #13837 * test: Add tests for Platform and unofficial node download URL Co-authored-by: taefi <taefi.soroosh@gmail.com> Co-authored-by: caalador <mikael.grankvist@vaadin.com> Co-authored-by: taefi <taefi.soroosh@gmail.com>
The issue is that Frontend tools always sets the default download url in As a workaround the you could define the parameter as |
As the default download root might be different depending on the used system we should not use a hardcoded default if user has not given a download root. Fixes #13837
* fix: Do not use a fixed download root As the default download root might be different depending on the used system we should not use a hardcoded default if user has not given a download root. Fixes #13837 * fix static mock
* fix: Do not use a fixed download root As the default download root might be different depending on the used system we should not use a hardcoded default if user has not given a download root. Fixes #13837 * fix static mock
As the default download root might be different depending on the used system we should not use a hardcoded default if user has not given a download root. Fixes #13837
As the default download root might be different depending on the used system we should not use a hardcoded default if user has not given a download root. Fixes #13837
As the default download root might be different depending on the used system we should not use a hardcoded default if user has not given a download root. Fixes #13837
As the default download root might be different depending on the used system we should not use a hardcoded default if user has not given a download root. Fixes #13837
* fix: Do not use a fixed download root (#14632) As the default download root might be different depending on the used system we should not use a hardcoded default if user has not given a download root. Fixes #13837 * Set default in prepare-frontend Co-authored-by: caalador <mikael.grankvist@vaadin.com>
This ticket/PR has been released with Vaadin 23.1.11. |
Thank you for having a look into this however it still doesn't seem to work with When doing a
and then it just stops and seems to hang up... The problem does not occur when NodeJS is preinstalled using
My setup is still the same as described in #13837 (comment) |
Does the installed node and npm versions in .vaadin work from the command line? |
This may be caused by the Alpine image. I reproduced this issue when building with Vaadin 24 in the eclipse-temurin:17-jdk-alpine image. After replacing it with eclipse-temurin:17-jdk, the problem was solved. |
Description of the bug
The automatic installation of NodeJS is not working on Alpine Linux or any other Linux distribution that uses musl instead of libgc
NPM get's downloaded however it's not executable (fails with
error=2, No such file or directory
).The error message is a bit confusing as the file itself exists but the linked libraries don't.
When inspecting the downloaded binary with
ldd
the following is returned:Currently applied workaround by us:
# Install latest LTS nodejs and npm RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main/ nodejs RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community/ npm
Related helpful issue: nvm-sh/nvm#1102
Expected behavior
Optimal solution
The correct npm/nodejs is installed for Alpine Linux/musl.
Solution that would improve handling the problem
If Alpine linux/musl is detected and the above error occurs print something like: "Please install nodejs/npm manually for alpine linux due to ..."
Minimal reproducible example
docker run --rm -it maven:3-eclipse-temurin-17-alpine /bin/bash
mvn -B archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
cd my-app/
mvn com.vaadin:vaadin-maven-plugin:prepare-frontend
Error message:
Versions
The text was updated successfully, but these errors were encountered: