jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.55k stars 4.02k forks source link

I can't execute the newly generated application #19500

Closed lucarota closed 2 years ago

lucarota commented 2 years ago
Overview of the issue

I can't execute the newly generated application. Running mvnw I get Build Failure.

[INFO] [INFO] --- frontend-maven-plugin:1.12.1:install-node-and-npm (install-node-and-npm) @ testerror --- [INFO] Node v16.16.0 is already installed. [INFO] NPM 8.15.1 is already installed. [INFO] [INFO] --- frontend-maven-plugin:1.12.1:npm (npm install) @ testerror --- [INFO] Running 'npm install' in C:\Sviluppo\sandbox\testerror [INFO] npm ERR! code 127 [INFO] npm ERR! path C:\Sviluppo\sandbox\testerror\node_modules\@fortawesome\free-solid-svg-icons [INFO] npm ERR! command failed [INFO] npm ERR! command bash /C/Users/lrota/AppData/Local/Temp/postinstall-f5be6e6f.sh [INFO] npm ERR! /bin/bash: /C/Users/lrota/AppData/Local/Temp/postinstall-f5be6e6f.sh: No such file or directory [INFO] [INFO] npm ERR! A complete log of this run can be found in: [INFO] npm ERR! C:\Users\lrota\AppData\Local\npm-cache_logs\2022-08-22T08_05_00_327Z-debug-0.log [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:46 min [INFO] Finished at: 2022-08-22T10:06:38+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:npm (npm install) on project testerror: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Motivation for or Use Case

Using JHipster 7.8.1 everything is fine.

Reproduce the error

C:\Sviluppo\sandbox>mkdir testerror

C:\Sviluppo\sandbox>cd testerror

C:\Sviluppo\sandbox\testerror>jhipster INFO! Using bundled JHipster ... omissis ... Welcome to JHipster v7.9.2

Application files will be generated in folder: C:\Sviluppo\sandbox\testerror


Documentation for creating an application is at https://www.jhipster.tech/creating-an-app/ If you find JHipster useful, consider sponsoring the project at https://opencollective.com/generator-jhipster


? Which type of application would you like to create? Monolithic application (recommended for simple projects) ? What is the base name of your application? testerror ? Do you want to make it reactive with Spring WebFlux? No ? What is your default Java package name? com.mycompany.myapp ? Which type of authentication would you like to use? JWT authentication (stateless, with a token) ? Which type of database would you like to use? SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL) ? Which production database would you like to use? MySQL ? Which development database would you like to use? MySQL ? Which cache do you want to use? (Spring cache abstraction) Caffeine (local cache, for a single node) ? Do you want to use Hibernate 2nd level cache? Yes ? Would you like to use Maven or Gradle for building the backend? Maven ? Do you want to use the JHipster Registry to configure, monitor and scale your application? No ? Which other technologies would you like to use? ? Which Framework would you like to use for the client? Angular ? Do you want to generate the admin UI? Yes ? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Cerulean ? Choose a Bootswatch variant navbar theme (https://bootswatch.com/)? Primary ? Would you like to enable internationalization support? Yes ? Please choose the native language of the application Italian ? Please choose additional languages to install English ? Besides JUnit and Jest, which testing frameworks would you like to use? Cucumber ? Would you like to install other generators from the JHipster Marketplace? No ... omissis ...

C:\Sviluppo\sandbox\testerror>mvnw [INFO] Scanning for projects... [INFO] [INFO] -------------------< com.mycompany.myapp:testerror >-------------------- [INFO] Building Testerror 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] >>> spring-boot-maven-plugin:2.7.2:run (default-cli) > test-compile @ testerror >>> ... omissis ... [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:npm (npm install) on project testerror: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Related issues

https://github.com/jhipster/generator-jhipster/issues/19450

Suggest a Fix
JHipster Version(s)

JHipster 7.9.2

JHipster configuration

C:\Sviluppo\sandbox\testerror>jhipster info INFO! Switching to JHipster installed locally in current project's node repository (node_modules) INFO! Using bundled JHipster ...omissis... Welcome to JHipster v7.9.2

Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
testerror@0.0.1-SNAPSHOT C:\Sviluppo\sandbox\testerror
`--  (generator-jhipster) invalid error: ENOENT: no such file or directory, open 'C:\Sviluppo\sandbox\testerror\node_modules\generator-jhipster\package.json
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "testerror",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "caffeine",
    "clientFramework": "angularX",
    "clientPackageManager": "npm",
    "clientTheme": "cerulean",
    "clientThemeVariant": "primary",
    "creationTimestamp": 1661154563132,
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "devServerPort": 4200,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entitySuffix": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.9.2",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "languages": ["en", "fr"],
    "messageBroker": false,
    "microfrontend": false,
    "microfrontends": [],
    "nativeLanguage": "en",
    "otherModules": [],
    "packageName": "com.mycompany.myapp",
    "pages": [],
    "prodDatabaseType": "mysql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": "8080",
    "serverSideOptions": [],
    "serviceDiscoveryType": "no",
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": ["cucumber"],
    "websocket": false,
    "withAdminUi": true
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

openjdk version "11.0.12" 2021-07-20 LTS OpenJDK Runtime Environment Zulu11.50+19-CA (build 11.0.12+7-LTS) OpenJDK 64-Bit Server VM Zulu11.50+19-CA (build 11.0.12+7-LTS, mixed mode)

git version 2.32.0.windows.2

node: v14.15.3

npm: 6.14.9

No change to package.json was detected. No package manager install will be executed. Congratulations, JHipster execution is complete! Sponsored with ❤️ by @oktadev.

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Windows 10

ongrieh commented 2 years ago

Same here...Since 7.9.2 I get npm ERR! command bash on Windows related to @fortawesome/fontawesome... . Possibly related to https://github.com/FortAwesome/Font-Awesome/issues/19243 and https://github.com/FortAwesome/Font-Awesome/issues/18803 but I may be wrong.

ongrieh commented 2 years ago

...and even more important related to https://github.com/jhipster/generator-jhipster/issues/19225 and https://github.com/jhipster/generator-jhipster/pull/18936. So hopefully it will be fixed with 7.9.3 :)

mraible commented 2 years ago

Can y'all try and see if it's fixed on the main branch?

git clone git@github.com:jhipster/generator-jhipster.git
cd generator-jhipster
npm link

Then, go to a new directory and create your app.

cd ~/Downloads
take newapp
jhipster
ongrieh commented 2 years ago

Thanks @mraible for the quick reply. Deleting the generated .npmrc worked as a workaround for me as suggested by @OmarHawk here https://github.com/jhipster/generator-jhipster/issues/19350.

lucarota commented 2 years ago

Using the main branch, it works. For now, I'll use the workaround as @ongrieh but when will the version with the fix be available?

Thank you!

mraible commented 2 years ago

This fix will be included in the 7.9.3 release. You can track it at https://github.com/jhipster/generator-jhipster/milestone/208.

mraible commented 2 years ago

Closing this issue since it's fixed in the next release.