Jhipster 失败并显示:“[HPM] 尝试将请求 /management/info 从 localhost:9000 代理到 http://localhost:8080 (ECONNREFUSED) 时发生错误”

Jhipster fails with: "[HPM] Error occurred while trying to proxy request /management/info from localhost:9000 to http://localhost:8080 (ECONNREFUSED)"

我正在尝试使用 jhipster 创建一个简单的项目框架。

# Ubuntu 18.04
node -v
# v10.15.1
npm -v
# 6.4.1
jhipster --version
# 6.0.0
jhipster
# (I only press enter, so that the defaults are selected)
npm start

现在我在 9000 端口上访问应用程序,但是当我尝试根据提示使用 admin/admin 登录时,它失败了

[HPM] Error occurred while trying to proxy request /management/info from localhost:9000 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while trying to proxy request /api/account from localhost:9000 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while trying to proxy request /api/authenticate from localhost:9000 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

当我尝试从应用程序注册新用户时也是如此。

这是应用程序的错误,还是我做错了什么?

您只是 运行 前端,您还需要像@Jon Ruddell 评论那样启动后端。在应用程序根目录上使用 Maven 运行:“./mvnw”("mvnw" on Windows)

Running the Java server

As a “main” Java class

From your IDE, right-click on the “Application” class at the root of your Java package hierarchy, and run it directly. You should also be able to debug it as easily.

The application will be available on http://localhost:8080.

This application will have “hot reload” enabled by default, so if you compile a class, the Spring application context should refresh itself automatically, without the need to restart the server.

As a Maven project

You can launch the Java server with Maven. JHipster provides a Maven wrapper, so you don’t need to install Maven, and you have the guarantee that all project users have the same Maven version:

./mvnw (on Mac OS X/Linux) of mvnw (on Windows)

(this will run our default Maven task, spring-boot:run)

The application will be available on http://localhost:8080.

Alternatively, if you have installed Maven, you can launch the Java server with Maven:

mvn

If you want more information on using Maven, please go to http://maven.apache.org

(Optional) As a Gradle project

If you selected the Gradle option, JHipster provides a Gradle wrapper, so you don’t need to install Gradle, and you have the guarantee that all project users have the same Gradle version:

./gradlew (on Mac OS X/Linux) of gradlew (on Windows)

(this will run our default Gradle task, bootRun)

Alternatively, if you have installed Gradle, you can launch the Java server with Gradle:

gradle

The application will be available on http://localhost:8080.

If you want more information on using Gradle, please go to https://gradle.org

来源:https://www.jhipster.tech/development/