簡體   English   中英

無法在 CentOS 7 上安裝 JHipster

[英]Cannot install JHipster on CentOS 7

操作系統:CentOS 7 (centos-release-7-7.1908.0.el7.centos.x86_64)

注意:此操作系統是在 Oracle VirtualBox 6.0 中運行的虛擬機。

我一直按照 JHipster 安裝頁面( https://www.jhipster.tech/installation/ )提供的說明進行操作。

我通過 yum 安裝了 OpenJDK 11:

> 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)

然后我通過 yum 安裝了 nodejs:

> 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 版本。

請指教。

更新

經過更多搜索后,我發現了一些信息,這些信息使我能夠成功安裝更新版本的 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 運行(如下),node.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

錯誤消息並沒有給我留下溫暖和模糊的感覺。

我已經能夠通過創建一個目錄、cd 到它並運行./jhipster來生成一個 JHipster“項目”。 這需要一段時間並生成大量材料。

這是 JHipster 運行 output (抱歉,很長):

請注意警告和錯誤消息。

[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!

這里發生了很多事情,警告和失敗消息並沒有給我很大的信心。 我將嘗試運行並與生成的任何內容進行交互。

我終於想出了如何成功安裝 JHispter(對於我的系統和配置)。

我需要將 maven 更新到更新的版本(3.6.2)。 I needed to set the environment variable MAVEN_OPTS to define the proxy arguments that maven/mvnw wants: http.proxyHost, http.proxyPort, https.proxyHost and https.proxyPort.

一旦完成,我就能夠成功安裝 JHipster 並使用它來生成。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM