-
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
vaadinBuildFrontend fails because Vaadin cannot install node #13623
Comments
same Problem as in #9004 |
"another solution was to install npm yourself." this is NO solution! |
It should always be possible for you to install node as part of your build. Either by downloading and running the Node installer like Vaadin does or by using the appropriate package manager. If you cannot do it then Vaadin cannot either. |
It seems related to #13837, since alpine base image is in use |
Solution for Jenkins Users: Place this into your Jenkinsfile |
I had the same error when building an application in azure / pipeline
(I also tried to install the version that was built a month ago) There may be a problem with nodejs version 16.15.1 When I added a step
problem still existed (nodejs 16.15.1) but when I set version to 16.15.0 problem stopped occurring
|
Description of the bug
Hey,
we build a Spring Boot App (3.6.1) with Java 17.0.1, Vaadin 23.0.6 configured with gradle.
When i run it in dev mode locally on a Windows Laptop, App can be loaded successfully.
But running this in the ci/cd - pipeline on eclipse-temurin:17-alpine - Image with the following command
./gradlew vaadinBuildFrontend --info --stacktrace
Then i get following error (complete stacktrace omitted):
´´´
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app-server:vaadinPrepareFrontend'.
...
Caused by: java.lang.IllegalStateException: Failed to install Node
...
Unpacking /root/.vaadin/node-v16.14.2-linux-x64.tar.gz into /root/.vaadin/node/tmp
Copying node binary from /root/.vaadin/node/tmp/node-v16.14.2-linux-x64/bin/node to /root/.vaadin/node/node
Extracting npm
Local node installation successful.
Error checking if node is new enough
com.vaadin.flow.server.frontend.FrontendUtils$UnknownVersionException: Unable to detect version of node. Using command /root/.vaadin/node/node --version
´´´
So the downloaded tar can be unpacked, but not successfully called.
Expected behavior
Npm should be installed correctly, so that the Front-End can be build
Minimal reproducible example
create vaadin project with spring initializer:
https://start.spring.io/#!type=gradle-project&language=java&platformVersion=2.6.7&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=vaadin
create DemoView
@route("")
public class DemoView extends VerticalLayout {
}
image: docker:latest
services:
stages:
before_script:
pwd
/.gradlegradle-build-frontend:
image: eclipse-temurin:17-alpine
stage: build-frontend
script: ./gradlew vaadinBuildFrontend --info --stacktrace
fails with:
Couldn't find node. Installing Node and NPM to /root/.vaadin.
Installing node version v14.15.4
Downloading https://nodejs.org/dist/v14.15.4/node-v14.15.4-linux-x64.tar.gz to /root/.vaadin/node-v14.15.4-linux-x64.tar.gz
No proxies configured
No proxy was configured, downloading directly
Unpacking /root/.vaadin/node-v14.15.4-linux-x64.tar.gz into /root/.vaadin/node/tmp
Copying node binary from /root/.vaadin/node/tmp/node-v14.15.4-linux-x64/bin/node to /root/.vaadin/node/node
Extracting NPM
Local node installation successful.
Error checking if node is new enough
com.vaadin.flow.server.frontend.FrontendUtils$UnknownVersionException: Unable to detect version of node. Using command /root/.vaadin/node/node --version
at com.vaadin.flow.server.frontend.FrontendUtils.getVersion(FrontendUtils.java:827)
at com.vaadin.flow.server.frontend.FrontendTools.validateNodeAndNpmVersion(FrontendTools.java:385)
at com.vaadin.gradle.VaadinPrepareFrontendTask.vaadinPrepareFrontend(VaadinPrepareFrontendTask.kt:77)
at java.base@17.0.2/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base@17.0.2/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base@17.0.2/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base@17.0.2/java.lang.reflect.Method.invoke(Method.java:568)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
Versions
The text was updated successfully, but these errors were encountered: