Heroku - GIT 部署任务:npmInstall 失败
Heroku - GIT Deployment Task :npmInstall FAILED
我初始化了一个 JHipster 项目并尝试将其部署到 heroku。我只做了这些并得到了下面的错误。我不确定问题出在哪里,我认为我使用的是 Jhipster 版本或 Heroku。我应该尝试切换到另一个版本的 JHipster,还是这可能是我本地设置的问题(npm-、node-、java-、gralde-version)?
JHipster 版本
generator-jhipster@6.10.1
JHipster 配置
{
"generator-jhipster": {
"promptValues": {
"packageName": "io.profit.testify",
"nativeLanguage": "en"
},
"jhipsterVersion": "6.10.1",
"applicationType": "monolith",
"baseName": "priv",
"packageName": "io.profit.testify",
"packageFolder": "io/profit/testify",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "ehcache",
"enableHibernateCache": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "gradle",
"enableSwaggerCodegen": false,
"jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
"embeddableLaunchScript": false,
"useSass": true,
"clientPackageManager": "npm",
"clientFramework": "angularX",
"clientTheme": "none",
"clientThemeVariant": "",
"creationTimestamp": 1595760910320,
"testFrameworks": [],
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"enableTranslation": true,
"nativeLanguage": "en",
"languages": ["en", "de"],
"blueprints": [],
"herokuAppName": "afternoon-falls-71420",
"herokuDeployType": "git",
"herokuJavaVersion": "11"
}
}
环境和工具
java 版本 "11.0.6" 2020-01-14 LTS
Java(TM) SE 运行时环境 18.9(构建 11.0.6+8-LTS)
Java HotSpot(TM) 64 位服务器 VM 18.9(构建 11.0.6+8-LTS,混合模式)
git 版本 2.20.1.windows.1
节点:v12.2.0
npm: 6.9.0
自耕农:3.1.1
来自 Heroku 控制台的错误:
Downloading https://services.gradle.org/distributions/gradle-6.5-bin.zip
remote: .................................................................................................
remote: To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.5/userguide/gradle_daemon.html.
remote: Daemon will be stopped at the end of the build stopping after processing
remote: > Task :bootBuildInfo
remote: > Task :nodeSetup SKIPPED
remote: > Task :npmSetup SKIPPED
remote: > Task :npmInstall FAILED
remote:
remote: FAILURE: Build failed with an exception.
remote:
remote: * What went wrong:
remote: Execution failed for task ':npmInstall'.
remote: > A problem occurred starting process 'command 'npm''
如果您想设置正确的 gradle 任务,您可以通过 heroku cli 手动设置它:
heroku config:set GRADLE_TASK="stage -Pprod -PnodeInstall"
如果构建包未正确设置,请通过
配置
heroku buildpacks:add heroku/gradle
之后尝试通过
再次推送
git push heroku master
构建应该会再次运行。
我初始化了一个 JHipster 项目并尝试将其部署到 heroku。我只做了这些并得到了下面的错误。我不确定问题出在哪里,我认为我使用的是 Jhipster 版本或 Heroku。我应该尝试切换到另一个版本的 JHipster,还是这可能是我本地设置的问题(npm-、node-、java-、gralde-version)?
JHipster 版本 generator-jhipster@6.10.1
JHipster 配置
{
"generator-jhipster": {
"promptValues": {
"packageName": "io.profit.testify",
"nativeLanguage": "en"
},
"jhipsterVersion": "6.10.1",
"applicationType": "monolith",
"baseName": "priv",
"packageName": "io.profit.testify",
"packageFolder": "io/profit/testify",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "ehcache",
"enableHibernateCache": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "gradle",
"enableSwaggerCodegen": false,
"jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
"embeddableLaunchScript": false,
"useSass": true,
"clientPackageManager": "npm",
"clientFramework": "angularX",
"clientTheme": "none",
"clientThemeVariant": "",
"creationTimestamp": 1595760910320,
"testFrameworks": [],
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"enableTranslation": true,
"nativeLanguage": "en",
"languages": ["en", "de"],
"blueprints": [],
"herokuAppName": "afternoon-falls-71420",
"herokuDeployType": "git",
"herokuJavaVersion": "11"
}
}
环境和工具
java 版本 "11.0.6" 2020-01-14 LTS Java(TM) SE 运行时环境 18.9(构建 11.0.6+8-LTS) Java HotSpot(TM) 64 位服务器 VM 18.9(构建 11.0.6+8-LTS,混合模式)
git 版本 2.20.1.windows.1
节点:v12.2.0
npm: 6.9.0
自耕农:3.1.1
来自 Heroku 控制台的错误:
Downloading https://services.gradle.org/distributions/gradle-6.5-bin.zip
remote: .................................................................................................
remote: To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.5/userguide/gradle_daemon.html.
remote: Daemon will be stopped at the end of the build stopping after processing
remote: > Task :bootBuildInfo
remote: > Task :nodeSetup SKIPPED
remote: > Task :npmSetup SKIPPED
remote: > Task :npmInstall FAILED
remote:
remote: FAILURE: Build failed with an exception.
remote:
remote: * What went wrong:
remote: Execution failed for task ':npmInstall'.
remote: > A problem occurred starting process 'command 'npm''
如果您想设置正确的 gradle 任务,您可以通过 heroku cli 手动设置它:
heroku config:set GRADLE_TASK="stage -Pprod -PnodeInstall"
如果构建包未正确设置,请通过
配置heroku buildpacks:add heroku/gradle
之后尝试通过
再次推送git push heroku master
构建应该会再次运行。