Не удается установить JHipster на CentOS 7 - PullRequest
0 голосов
/ 16 октября 2019

ОС : CentOS 7 (centos-release-7-7.1908.0.el7.centos.x86_64)

Примечание : эта ОС является виртуальной машинойработает в Oracle VirtualBox 6.0.

Я следовал инструкциям, приведенным на странице установки JHipster (https://www.jhipster.tech/installation/).

Я установил OpenJDK 11 через yum:

> sudo yum install java-11-openjdk
...
> java -version
openjdk version "11.0.4" 2019-07-16 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.4+11-LTS)

Затем я установил nodejs через yum:

> sudo yum install nodejs

Это установило следующее:

> node –v
v6.17.1
> npm –v
3.10.10

Затем я попытался установить JHispter:

> sudo npm install –g generator-jhipster

Это привело к следующему:

[jgagnon@centos7-1 ~]$ sudo npm install -g generator-jhipster
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
/usr/bin/jhipster -> /usr/lib/node_modules/generator-jhipster/cli/jhipster.js

> core-js@3.3.2 postinstall /usr/lib/node_modules/generator-jhipster/node_modules/core-js
> node postinstall || echo "ignore"


> spawn-sync@1.0.15 postinstall /usr/lib/node_modules/generator-jhipster/node_modules/spawn-sync
> node postinstall


> yo@3.1.0 postinstall /usr/lib/node_modules/generator-jhipster/node_modules/yo
> yodoctor

/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-doctor/lib/index.js:12
  (async () => {
         ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-doctor/lib/cli.js:3:1)
/usr/lib
└── (empty)

npm ERR! Linux 3.10.0-1062.1.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "install" "-g" "generator-jhipster"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! yo@3.1.0 postinstall: `yodoctor`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the yo@3.1.0 postinstall script 'yodoctor'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     yodoctor
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs yo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls yo
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/jgagnon/npm-debug.log
npm ERR! code 1

Есть ли у меня несовместимая версия node.js / npm? Если да, как мне обновить ее на этом компьютере? Я уже сделал sudo yum update, и ничего не было обновлено.

Последняя версия Node.js (с их сайта) - 10.16.3 LTS, но я не знаю, как правильно установить ее на эту систему. Кроме того, я не знаю, есть ли эта версияможет даже работать на версии CentOS, которую я использую.

Пожалуйста, сообщите.

ОБНОВЛЕНИЕ

AfteПосле еще нескольких поисков я нашел информацию, которая позволила мне успешно установить более свежую версию Node.js. Это позволило мне установить JHipster и yo, хотя все еще существуют некоторые тревожные проблемы.

> sudo curl –sL https://rpm.nodesource.com/setup_12.x | sudo bash -
> sudo yum install –y nodejs

> node –v
V12.11.1
> npm –v
6.11.3

Примечание : В соответствии с запуском jhipster (ниже) установленная версия узла. JS не является LTS ( что бы это ни значило ). Он отображает предупреждающее сообщение и продолжает.

Кто-нибудь знает о значении Node.js как LTS и, если это необходимо, как мне получить более новую версию Node.js для LTS?

Попытка установить JHipster:

[jgagnon@centos7-1 ~]$ sudo npm install -g generator-jhipster
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
/usr/bin/jhipster -> /usr/lib/node_modules/generator-jhipster/cli/jhipster.js

> core-js@3.3.2 postinstall /usr/lib/node_modules/generator-jhipster/node_modules/core-js
> node postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> spawn-sync@1.0.15 postinstall /usr/lib/node_modules/generator-jhipster/node_modules/spawn-sync
> node postinstall


> yo@3.1.0 postinstall /usr/lib/node_modules/generator-jhipster/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
ErrorClass [RequestError]: connect ETIMEDOUT 104.16.27.35:443
    at ClientRequest.<anonymous> (/usr/lib/node_modules/generator-jhipster/node_modules/latest-version/node_modules/got/index.js:73:21)
    at Object.onceWrapper (events.js:300:26)
    at ClientRequest.emit (events.js:210:5)
    at TLSSocket.socketErrorListener (_http_client.js:406:9)
    at TLSSocket.emit (events.js:210:5)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'ETIMEDOUT',
  message: 'connect ETIMEDOUT 104.16.27.35:443',
  host: 'registry.npmjs.org',
  hostname: 'registry.npmjs.org',
  method: 'GET',
  path: '/yo'
}
✖ yo version
ErrorClass [RequestError]: connect ETIMEDOUT 104.16.27.35:443
    at ClientRequest.<anonymous> (/usr/lib/node_modules/generator-jhipster/node_modules/latest-version/node_modules/got/index.js:73:21)
    at Object.onceWrapper (events.js:300:26)
    at ClientRequest.emit (events.js:210:5)
    at TLSSocket.socketErrorListener (_http_client.js:406:9)
    at TLSSocket.emit (events.js:210:5)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'ETIMEDOUT',
  message: 'connect ETIMEDOUT 104.16.27.35:443',
  host: 'registry.npmjs.org',
  hostname: 'registry.npmjs.org',
  method: 'GET',
  path: '/yo'
}

Found potential issues on your machine :(
+ generator-jhipster@6.4.1
added 782 packages from 414 contributors in 937.516s

Сообщения об ошибках не оставляют у меня ощущение тепла и нечеткости.

Мне удалось создать JHipster "Проект ", создав каталог, перейдя в него и запустив ./jhipster. Это занимает некоторое время и генерирует много материала.

Вот вывод прогона JHipster (извините, он длинный):

Обратите внимание на предупреждения и сообщения об ошибках.

[jgagnon@centos7-1 test_jhipster_app]$ 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 v6.4.1
Application files will be generated in folder: /home/jgagnon/workspace/test_jhipster_app
 _______________________________________________________________________________________________________________

  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! Your Node version is not LTS (Long Term Support), use it at your own risk! JHipster does not support non-LTS releases, so if you encounter a bug, please use a LTS version first.
? May JHipster anonymously report usage statistics to improve the tool over time? No
? Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
? What is the base name of your application? test_jhipster_app
? What is your default Java package name? com.mycompany.myapp
? Do you want to use the JHipster Registry to configure, monitor and scale your application? No
? 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? MySQL
? Which *development* database would you like to use? H2 with disk-based persistence
? Do you want to use the Spring cache abstraction? Yes, with the Ehcache implementation (local cache, for a single node)
? Do you want to use Hibernate 2nd level cache? No
? Would you like to use Maven or Gradle for building the backend? Maven
? Which other technologies would you like to use? (Press <space> to select, <a> to toggle all, <i> to invert selection)
? Which *Framework* would you like to use for the client? Angular
WARNING! Could not fetch bootswatch themes from API. Using default ones.
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
? Would you like to enable internationalization support? No
? Besides JUnit and Jest, which testing frameworks would you like to use? (Press <space> to select, <a> to toggle all, <i> to invert selection)
? Would you like to install other generators from the JHipster Marketplace? No
/bin/sh: /usr/lib/jvm/java-11-openjdk-11.0.4.11-1.el7_7.x86_64/bin/bin/keytool: No such file or directory
WARNING! 
Failed to create a KeyStore with 'keytool'
Git repository initialized.

<all the creation statements removed for brevity>

I'm all done. Running npm install for you to install the required dependencies. If this fails, try running the command yourself.


npm WARN deprecated swagger-ui@2.2.10: No longer maintained, please upgrade to swagger-ui@3.
npm WARN deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()

> husky@3.0.4 install /home/jgagnon/workspace/test_jhipster_app/node_modules/husky
> node husky install

husky > Setting up git hooks
Husky requires Git >= 2.13.2, please update Git
husky > Failed to install

> core-js@2.6.10 postinstall /home/jgagnon/workspace/test_jhipster_app/node_modules/babel-runtime/node_modules/core-js
> node postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js@3.2.1 postinstall /home/jgagnon/workspace/test_jhipster_app/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> spawn-sync@1.0.15 postinstall /home/jgagnon/workspace/test_jhipster_app/node_modules/spawn-sync
> node postinstall


> yo@3.1.0 postinstall /home/jgagnon/workspace/test_jhipster_app/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
ErrorClass [RequestError]: connect ETIMEDOUT 104.16.17.35:443
    at ClientRequest.<anonymous> (/home/jgagnon/workspace/test_jhipster_app/node_modules/latest-version/node_modules/got/index.js:73:21)
    at Object.onceWrapper (events.js:300:26)
    at ClientRequest.emit (events.js:210:5)
    at TLSSocket.socketErrorListener (_http_client.js:406:9)
    at TLSSocket.emit (events.js:210:5)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'ETIMEDOUT',
  message: 'connect ETIMEDOUT 104.16.17.35:443',
  host: 'registry.npmjs.org',
  hostname: 'registry.npmjs.org',
  method: 'GET',
  path: '/yo'
}
✖ yo version
ErrorClass [RequestError]: connect ETIMEDOUT 104.16.17.35:443
    at ClientRequest.<anonymous> (/home/jgagnon/workspace/test_jhipster_app/node_modules/latest-version/node_modules/got/index.js:73:21)
    at Object.onceWrapper (events.js:300:26)
    at ClientRequest.emit (events.js:210:5)
    at TLSSocket.socketErrorListener (_http_client.js:406:9)
    at TLSSocket.emit (events.js:210:5)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'ETIMEDOUT',
  message: 'connect ETIMEDOUT 104.16.17.35:443',
  host: 'registry.npmjs.org',
  hostname: 'registry.npmjs.org',
  method: 'GET',
  path: '/yo'
}

Found potential issues on your machine :(

> @angular/cli@8.3.1 postinstall /home/jgagnon/workspace/test_jhipster_app/node_modules/@angular/cli
> node ./bin/postinstall/script.js

? Would you like to share anonymous usage data with the Angular Team at Google under
Google’s Privacy Policy at https://policies.google.com/privacy? For more details and
how to change this setting, see http://angular.io/analytics. No

> husky@3.0.4 postinstall /home/jgagnon/workspace/test_jhipster_app/node_modules/husky
> opencollective-postinstall || true

Thank you for using husky!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/husky/donate


> ngx-infinite-scroll@8.0.0 postinstall /home/jgagnon/workspace/test_jhipster_app/node_modules/ngx-infinite-scroll
> opencollective-postinstall

Thank you for using ngx-infinite-scroll!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/ngx-infinite-scroll/donate

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN @angular/core@8.2.4 requires a peer of zone.js@~0.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 2213 packages from 1042 contributors and audited 909567 packages in 1072.252s
found 3 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
Application successfully committed to Git from /home/jgagnon/workspace/test_jhipster_app.

If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Server application generated successfully.

Run your Spring Boot application:
./mvnw

Client application generated successfully.

Start your Webpack development server with:
 npm start


> test-jhipster-app@0.0.1-SNAPSHOT cleanup /home/jgagnon/workspace/test_jhipster_app
> rimraf target/classes/static/ target/classes/aot

INFO! Congratulations, JHipster execution is complete!

Здесь происходит очень много событий, и предупреждения и сообщения об ошибках не дают мне уверенности. Я попытаюсь запустить и взаимодействовать с тем, что было сгенерировано.

1 Ответ

0 голосов
/ 23 октября 2019

Я наконец понял, как успешно установить JHispter (для моей системы и конфигурации).

Мне нужно было обновить maven до более новой версии (3.6.2). Мне нужно было установить переменную окружения MAVEN_OPTS, чтобы определить параметры прокси, которые нужны maven / mvnw: http.proxyHost, http.proxyPort, https.proxyHost и https.proxyPort.

Как только это было сделано, я смогуспешно установите JHipster и используйте его для генерации.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...