英文:
Node.js error in Vaadin Spring Boot application
问题
尝试在Intellij IDEA
中运行包含以下build.gradle
的使用Vaadin创建CRUD UI项目:
plugins {
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
maven { url "https://maven.vaadin.com/vaadin-addons" }
}
dependencyManagement {
imports {
mavenBom 'com.vaadin:vaadin-bom:14.3.9'
}
}
dependencies {
implementation 'com.vaadin:vaadin-spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'com.h2database:h2'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
在运行项目时遇到了节点问题:
2020-10-07 19:01:42.637 INFO 8364 --- [ main] NodeInstaller : Installing node version v12.18.3
...
C:\Users\g\.vaadin\node\node.exe: bad option: --no-update-notifier
...
java.lang.RuntimeException: Unable to initialize Vaadin DevModeHandler
如何解决这个问题?
英文:
Trying to run Creating CRUD UI with Vaadin project in Intellij IDEA
thar contains following build.gradle
:
plugins {
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
maven { url "https://maven.vaadin.com/vaadin-addons" }
}
dependencyManagement {
imports {
mavenBom 'com.vaadin:vaadin-bom:14.3.9'
}
}
dependencies {
implementation 'com.vaadin:vaadin-spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'com.h2database:h2'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
Got node problem while run project:
2020-10-07 19:01:42.637 INFO 8364 --- [ main] NodeInstaller : Installing node version v12.18.3
2020-10-07 19:01:42.637 INFO 8364 --- [ main] NodeInstaller : Downloading https://nodejs.org/dist/v12.18.3/node-v12.18.3-win-x64.zip to C:\Users\g\.vaadin\node-v12.18.3-win-x64.zip
2020-10-07 19:01:42.638 INFO 8364 --- [ main] ProxyConfig : No proxies configured
2020-10-07 19:01:42.638 INFO 8364 --- [ main] FileDownloader : No proxy was configured, downloading directly
2020-10-07 19:01:52.244 INFO 8364 --- [ main] NodeInstaller : Unpacking C:\Users\g\.vaadin\node-v12.18.3-win-x64.zip into C:\Users\g\.vaadin\node\tmp
2020-10-07 19:01:54.523 INFO 8364 --- [ main] NodeInstaller : Copying node binary from C:\Users\g\.vaadin\node\tmp\node-v12.18.3-win-x64\node.exe to C:\Users\g\.vaadin\node\node.exe
2020-10-07 19:01:54.524 INFO 8364 --- [ main] NodeInstaller : Extracting NPM
2020-10-07 19:02:21.733 INFO 8364 --- [ main] NodeInstaller : Local node installation successful.
C:\Users\g\.vaadin\node\node.exe: bad option: --no-update-notifier
C:\Users\g\.vaadin\node\node.exe: bad option: --no-audit
C:\Users\g\.vaadin\node\node.exe: bad option: --scripts-prepend-node-path=true
2020-10-07 19:02:22.336 ERROR 8364 --- [ main] dev-updater : Command `C:\Users\g\.vaadin\node\node.exe --no-update-notifier --no-audit --scripts-prepend-node-path=true install` failed:
2020-10-07 19:02:22.336 ERROR 8364 --- [ main] dev-updater : >>> Dependency ERROR. Check that all required dependencies are deployed in npm repositories.
2020-10-07 19:02:22.340 ERROR 8364 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Exception sending context initialized event to listener instance of class [com.vaadin.flow.spring.VaadinServletContextInitializer$DevModeServletContextListener]
java.lang.RuntimeException: Unable to initialize Vaadin DevModeHandler
How to solve this problem?
答案1
得分: 3
Node.js的版本是vaadin附带的问题。安装最新版本的Node.js。转到其安装目录,复制node_modules文件夹和node.exe文件,然后将它们替换到C:\Users~.vaadin\node中。
英文:
The version of Node.js that comes with vaadin is the problem. Install the latest version of Node.js. Go to its installation directory copy node_modules folder and node.exe and replace those in C:\Users~.vaadin\node.
答案2
得分: 0
以下是已经翻译好的内容:
对我有帮助的是:
- 安装 npm,
- 将路径添加到 PATH,
- 重新启动控制台/集成开发环境。
英文:
For me was help:
- install npm,
- add path to PATH
- restart console/ide.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论