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

Jhipster 5.7.0 stuck at npm audit when creating new project #8861

Closed spotlesscoder closed 5 years ago

spotlesscoder commented 5 years ago
Overview of the issue

JHipster execution is stuck on creating new project

I just ran "jhipster" and was asked all the option which I answered according to my requirements. Then the project generation started,

Motivation for or Use Case

I want to start a new project.

Reproduce the error

Choose the options according to those from my log

user@user-System-Product-Name:~/jhipstertest$ jhipster
INFO! Using JHipster version installed globally
INFO! Running default command
INFO! Executing jhipster:app
INFO! Options: from-cli: true

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝

                            https://www.jhipster.tech

Welcome to JHipster v5.7.0
Application files will be generated in folder: /home/user/jhipstertest
 _______________________________________________________________________________________________________________

  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
 _______________________________________________________________________________________________________________

WARNING! Java 1.8 is not found on your computer. Your Java version is: 10.0.2
? Which *type* of application would you like to create? Microservice application
? What is the base name of your application? jhipstertest
? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8081
? What is your default Java package name? org.codingspiderfox
? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards)
? 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, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
? Which *production* database would you like to use? PostgreSQL
? Which *development* database would you like to use? H2 with in-memory persistence
? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes)
? Do you want to use Hibernate 2nd level cache? Yes
? Would you like to use Maven or Gradle for building the backend? Maven
? Which other technologies would you like to use? Search engine using Elasticsearch, Asynchronous messages using Apache Kafka, API first development using Open
API-generator
? Would you like to enable internationalization support? Yes
? Please choose the native language of the application English
? Please choose additional languages to install German
? Besides JUnit and Jest, which testing frameworks would you like to use? Cucumber
? Would you like to install other generators from the JHipster Marketplace? Yes
? Which other modules would you like to use? (generator-jhipster-nav-element-2.0.12) A generator to scaffold a new page (and the corresponding navigation menu)
 in a JHipster project., (generator-jhipster-docker-2.5.0) Additional Docker support: Docker Hub, Local SMTP Server, NGinx, (generator-jhipster-swagger-cli-3.0
.1) JHipster module to generate swagger client code from a swagger definition, (generator-jhipster-uaa-security-authority-1.0.1) A JHipster module that create 
uaa security authority restful resource for communication between uaa and microservices, (generator-jhipster-feign-client-1.0.6) JHipster module for create fei
gn client with entity for communication between two microservices, (generator-jhipster-aeropost-1.6.0) Add Scheduler Lock

Installing languages: en, de for server

KeyStore 'src/main/resources/config/tls/keystore.p12' generated successfully.

   create package.json
   create README.md
 conflict .gitignore
? Overwrite .gitignore? overwrite
    force .gitignore
identical .gitattributes
identical .editorconfig
   create src/main/jib/entrypoint.sh
   create src/main/docker/Dockerfile
   create src/main/docker/entrypoint.sh
   create src/main/docker/.dockerignore
   create src/main/docker/app.yml
   create src/main/docker/sonar.yml
   create src/main/docker/postgresql.yml
   create src/main/docker/hazelcast-management-center.yml
   create src/main/docker/elasticsearch.yml
   create src/main/docker/kafka.yml
   create src/main/docker/central-server-config/README.md
   create src/main/docker/jhipster-registry.yml
   create src/main/docker/central-server-config/docker-config/application.yml
   create src/main/docker/central-server-config/localhost-config/application.yml
   create src/main/docker/swagger-editor.yml
   create mvnw
   create mvnw.cmd
identical .mvn/wrapper/maven-wrapper.jar
identical .mvn/wrapper/maven-wrapper.properties
identical .mvn/wrapper/MavenWrapperDownloader.java
   create pom.xml
   create src/main/resources/banner.txt
   create src/main/resources/.h2.server.properties
   create src/main/resources/swagger/api.yml
   create src/main/resources/templates/error.html
   create src/main/resources/logback-spring.xml
   create src/main/resources/config/application.yml
   create src/main/resources/config/application-dev.yml
   create src/main/resources/config/application-tls.yml
   create src/main/resources/config/application-prod.yml
   create src/main/resources/i18n/messages.properties
   create src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml
   create src/main/resources/config/liquibase/master.xml
   create src/main/java/org/codingspiderfox/security/SpringSecurityAuditorAware.java
   create src/main/java/org/codingspiderfox/security/SecurityUtils.java
   create src/main/java/org/codingspiderfox/security/AuthoritiesConstants.java
   create src/main/java/org/codingspiderfox/security/package-info.java
   create src/main/java/org/codingspiderfox/security/jwt/TokenProvider.java
   create src/main/java/org/codingspiderfox/security/jwt/JWTFilter.java
   create src/main/java/org/codingspiderfox/security/jwt/JWTConfigurer.java
   create src/main/java/org/codingspiderfox/config/SecurityConfiguration.java
   create src/main/java/org/codingspiderfox/config/FeignConfiguration.java
   create src/main/java/org/codingspiderfox/client/UserFeignClientInterceptor.java
   create src/main/resources/static/index.html
   create src/main/resources/config/bootstrap.yml
   create src/main/resources/config/bootstrap-prod.yml
   create src/main/java/org/codingspiderfox/JhipstertestApp.java
   create src/main/java/org/codingspiderfox/ApplicationWebXml.java
   create src/main/java/org/codingspiderfox/aop/logging/LoggingAspect.java
   create src/main/java/org/codingspiderfox/config/DefaultProfileUtil.java
   create src/main/java/org/codingspiderfox/config/package-info.java
   create src/main/java/org/codingspiderfox/config/AsyncConfiguration.java
   create src/main/java/org/codingspiderfox/config/Constants.java
   create src/main/java/org/codingspiderfox/config/DateTimeFormatConfiguration.java
   create src/main/java/org/codingspiderfox/config/LoggingConfiguration.java
   create src/main/java/org/codingspiderfox/config/ApplicationProperties.java
   create src/main/java/org/codingspiderfox/config/JacksonConfiguration.java
   create src/main/java/org/codingspiderfox/config/LocaleConfiguration.java
   create src/main/java/org/codingspiderfox/config/LoggingAspectConfiguration.java
   create src/main/java/org/codingspiderfox/config/MetricsConfiguration.java
   create src/main/java/org/codingspiderfox/config/WebConfigurer.java
   create src/main/java/org/codingspiderfox/config/CacheConfiguration.java
   create src/main/java/org/codingspiderfox/config/CloudDatabaseConfiguration.java
   create src/main/java/org/codingspiderfox/config/DatabaseConfiguration.java
   create src/main/java/org/codingspiderfox/config/audit/package-info.java
   create src/main/java/org/codingspiderfox/config/audit/AuditEventConverter.java
   create src/main/java/org/codingspiderfox/config/LiquibaseConfiguration.java
   create src/main/java/org/codingspiderfox/config/ElasticsearchConfiguration.java
   create src/main/java/org/codingspiderfox/config/MessagingConfiguration.java
   create src/main/java/org/codingspiderfox/domain/package-info.java
   create src/main/java/org/codingspiderfox/domain/AbstractAuditingEntity.java
   create src/main/java/org/codingspiderfox/domain/PersistentAuditEvent.java
   create src/main/java/org/codingspiderfox/repository/search/package-info.java
   create src/main/java/org/codingspiderfox/repository/package-info.java
   create src/main/java/org/codingspiderfox/service/package-info.java
   create src/main/java/org/codingspiderfox/web/rest/errors/package-info.java
   create src/main/java/org/codingspiderfox/web/rest/errors/InternalServerErrorException.java
   create src/main/java/org/codingspiderfox/web/rest/errors/BadRequestAlertException.java
   create src/main/java/org/codingspiderfox/web/rest/errors/CustomParameterizedException.java
   create src/main/java/org/codingspiderfox/web/rest/errors/EmailAlreadyUsedException.java
   create src/main/java/org/codingspiderfox/web/rest/errors/EmailNotFoundException.java
   create src/main/java/org/codingspiderfox/web/rest/errors/ErrorConstants.java
   create src/main/java/org/codingspiderfox/web/rest/errors/ExceptionTranslator.java
   create src/main/java/org/codingspiderfox/web/rest/errors/FieldErrorVM.java
   create src/main/java/org/codingspiderfox/web/rest/errors/InvalidPasswordException.java
   create src/main/java/org/codingspiderfox/web/rest/errors/LoginAlreadyUsedException.java
   create src/main/java/org/codingspiderfox/web/rest/vm/package-info.java
   create src/main/java/org/codingspiderfox/web/rest/vm/LoggerVM.java
   create src/main/java/org/codingspiderfox/web/rest/util/HeaderUtil.java
   create src/main/java/org/codingspiderfox/web/rest/util/PaginationUtil.java
   create src/main/java/org/codingspiderfox/web/rest/package-info.java
   create src/main/java/org/codingspiderfox/web/rest/LogsResource.java
   create src/test/java/org/codingspiderfox/web/rest/TestUtil.java
   create src/test/java/org/codingspiderfox/web/rest/LogsResourceIntTest.java
   create src/test/java/org/codingspiderfox/web/rest/errors/ExceptionTranslatorIntTest.java
   create src/test/java/org/codingspiderfox/web/rest/errors/ExceptionTranslatorTestController.java
   create src/test/java/org/codingspiderfox/web/rest/util/PaginationUtilUnitTest.java
   create src/test/java/org/codingspiderfox/config/timezone/HibernateTimeZoneTest.java
   create src/test/java/org/codingspiderfox/repository/timezone/DateTimeWrapper.java
   create src/test/java/org/codingspiderfox/repository/timezone/DateTimeWrapperRepository.java
   create src/test/resources/config/application.yml
   create src/test/resources/logback.xml
   create src/test/java/org/codingspiderfox/config/WebConfigurerTest.java
   create src/test/java/org/codingspiderfox/config/WebConfigurerTestController.java
   create src/test/resources/config/bootstrap.yml
   create src/test/java/org/codingspiderfox/cucumber/CucumberTest.java
   create src/test/java/org/codingspiderfox/cucumber/stepdefs/StepDefs.java
   create src/test/features/gitkeep
   create src/main/resources/i18n/messages_en.properties
   create src/main/resources/i18n/messages_de.properties

Installing generator-jhipster@5.7.0 locally using npm

> spawn-sync@1.0.15 postinstall /home/user/jhipstertest/node_modules/spawn-sync
> node postinstall

npm notice created a lockfile as package-lock.json. You should commit this file.
added 724 packages from 439 contributors and audited 36151 packages in 6.394s
found 4 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

Then the command prompt doesn't return . However, htop shows that "git add -A" is using a whole CPU core @ 100%. When I press CTRL+C on the Jhipster command, that process gets terminated.

JHipster Version(s)

5.7.0

JHipster configuration
user@user-System-Product-Name:~/jhipstertest$ jhipster info
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:info
INFO! Options: from-cli: true
Welcome to the JHipster Information Sub-Generator

##### **JHipster Version(s)**

jhipstertest@0.0.0 /home/user/jhipstertest ├── generator-jhipster@5.7.0 ├─┬ generator-jhipster-aeropost@1.6.0 │ └── generator-jhipster@5.7.0 deduped ├─┬ generator-jhipster-docker@2.5.0 │ └── generator-jhipster@5.7.0 deduped ├─┬ generator-jhipster-feign-client@1.0.6 │ └── generator-jhipster@5.7.0 deduped ├─┬ generator-jhipster-nav-element@2.0.12 │ └── generator-jhipster@5.6.1 ├─┬ generator-jhipster-swagger-cli@3.0.1 │ └── generator-jhipster@5.7.0 deduped └─┬ generator-jhipster-uaa-security-authority@1.0.1 └── generator-jhipster@5.7.0 deduped


##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**

<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "org.codingspiderfox",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.7.0",
    "applicationType": "microservice",
    "baseName": "jhipstertest",
    "packageName": "org.codingspiderfox",
    "packageFolder": "org/codingspiderfox",
    "serverPort": "8081",
    "authenticationType": "jwt",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "prodDatabaseType": "postgresql",
    "searchEngine": "elasticsearch",
    "messageBroker": "kafka",
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSwaggerCodegen": true,
    "jwtSecretKey": "<hidden>",
    "testFrameworks": [
      "cucumber"
    ],
    "jhiPrefix": "jhi",
    "otherModules": [
      {
        "name": "generator-jhipster-nav-element",
        "version": "2.0.12"
      },
      {
        "name": "generator-jhipster-docker",
        "version": "2.5.0"
      },
      {
        "name": "generator-jhipster-swagger-cli",
        "version": "3.0.1"
      },
      {
        "name": "generator-jhipster-uaa-security-authority",
        "version": "1.0.1"
      },
      {
        "name": "generator-jhipster-feign-client",
        "version": "1.0.6"
      },
      {
        "name": "generator-jhipster-aeropost",
        "version": "1.6.0"
      }
    ],
    "enableTranslation": true,
    "clientPackageManager": "npm",
    "nativeLanguage": "en",
    "languages": [
      "en",
      "de"
    ],
    "skipClient": true,
    "skipUserManagement": true
  }
}
</pre>
</details>

##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**

<details>
<summary>JDL entity definitions</summary>

<pre>

</pre>
</details>

##### **Environment and Tools**

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3, mixed mode)

git version 2.17.1

node: v10.13.0

npm: 6.4.1

yeoman: 2.0.5

docker-compose version 1.23.1, build b02f130

INFO! Congratulations, JHipster execution is complete!

yo-rc.json

user@user-System-Product-Name:~/jhipstertest$ cat .yo-rc.json 
#{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "org.codingspiderfox",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.7.0",
    "applicationType": "microservice",
    "baseName": "jhipstertest",
    "packageName": "org.codingspiderfox",
    "packageFolder": "org/codingspiderfox",
    "serverPort": "8081",
    "authenticationType": "jwt",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "prodDatabaseType": "postgresql",
    "searchEngine": "elasticsearch",
    "messageBroker": "kafka",
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSwaggerCodegen": true,
    "jwtSecretKey": "<hidden>",
    "testFrameworks": [
      "cucumber"
    ],
    "jhiPrefix": "jhi",
    "otherModules": [
      {
        "name": "generator-jhipster-nav-element",
        "version": "2.0.12"
      },
      {
        "name": "generator-jhipster-docker",
        "version": "2.5.0"
      },
      {
        "name": "generator-jhipster-swagger-cli",
        "version": "3.0.1"
      },
      {
        "name": "generator-jhipster-uaa-security-authority",
        "version": "1.0.1"
      },
      {
        "name": "generator-jhipster-feign-client",
        "version": "1.0.6"
      },
      {
        "name": "generator-jhipster-aeropost",
        "version": "1.6.0"
      }
    ],
    "enableTranslation": true,
    "clientPackageManager": "npm",
    "nativeLanguage": "en",
    "languages": [
      "en",
      "de"
    ],
    "skipClient": true,
    "skipUserManagement": true
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

I don't have this directory on my machine

Browsers and Operating System

Browser: not relevant OS: ElementaryOS 5.0 Juno npm --version -> 6.4.1 node --version -> v10.13.0

ruddell commented 5 years ago

The npm audit results show after npm install completes, so I think the real issue is the git command getting stuck somehow

spotlesscoder commented 5 years ago

sounds plausible ... I tried the same steps on a fresh Ubuntu 18.04 installation and the command finishes successfully there

wmarques commented 5 years ago

Yes if npm is stuck, it's probably because of network issues or some interactive commands that are not displayed (ie: asking git credentials) so it looks just "stuck".

ruddell commented 5 years ago

I wasn't able to reproduce using an ElementaryOS docker image (both elementary/docker:juno-unstable and elementary/docker:loki). Does it happen every time you try to generate a project? Also, try using a new directory - it looks like you already tried to generate a project in that directory (you are overwriting files)

spotlesscoder commented 5 years ago

Also couldn reproduce it. Somehow it works now on my system (removed all the files that were created by jh in my home dir and used a new dir)

khushboo894 commented 4 years ago

Facing the same issue

gmarziou commented 4 years ago

@khushboo894 Unfortunately, there's nothing we can do about it, it could depend on so many environmental factors: your OS, network, firewall, anti virus, etc...

What you could try as a workaround (assuming this is really due to audit)

Let us know if it helped

dranzerashi commented 3 years ago

happening to me on a fresh install of jhipster and npm on my windows machine

dranzerashi commented 3 years ago
circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
[                  ] - reify:generator-jhipster: timing reifyNode:node_modules/aws-sdk Completed in 249957ms

its stuck here

gmarziou commented 3 years ago

@dranzerashi please don't comment on an old closed issue about an obsolete version, if you have a similar issue with current version please open a new issue with all required details.