繁体   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