无法安装 jhipster-generator

Posted

技术标签:

【中文标题】无法安装 jhipster-generator【英文标题】:Cannot install jhipster-generator 【发布时间】:2017-07-13 02:28:19 【问题描述】:

我正在尝试遵循 jhipster 网站上的安装指南,但我什至无法运行第一条指令,它使 ETIMEDOUT 一直在我身上。我现在运行它大约 30 次,它一直失败(有时在不同的 url)

apixandru@DESKTOP-BAA6A1B MINGW64 ~
$ yarn global add generator-jhipster
yarn global v0.20.3
[1/4] Resolving packages...
warning generator-jhipster > yo > fullname > npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
error An unexpected error occurred: "https://registry.yarnpkg.com/lodash: connect ETIMEDOUT 104.16.59.173:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\apixandru\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

apixandru@DESKTOP-BAA6A1B MINGW64 ~
$ yarn global add generator-jhipster
yarn global v0.20.3
[1/4] Resolving packages...
warning generator-jhipster > yo > fullname > npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
error An unexpected error occurred: "https://registry.yarnpkg.com/js-yaml: connect ETIMEDOUT 104.16.59.173:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\apixandru\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

apixandru@DESKTOP-BAA6A1B MINGW64 ~
$ yarn global add generator-jhipster
yarn global v0.20.3
[1/4] Resolving packages...
warning generator-jhipster > yo > fullname > npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
error An unexpected error occurred: "https://registry.yarnpkg.com/html-wiring: connect ETIMEDOUT 104.16.62.173:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\apixandru\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

看起来它开始发出数百个获取请求,最终服务器拒绝响应我。我不明白为什么这些响应没有在本地缓存,所以我不必每次重试时都执行数百个请求

https://paste.ubuntu.com/24048741/

【问题讨论】:

您在防火墙后面吗?您可以从浏览器访问registry.yarnpkg.com/generator-jhipster 吗?您是否尝试过使用 npm install -g generator-jhipster 安装 jhipstrer? 您还需要提供更多信息,您是否对其他包有问题,或者只是对这个生成器有问题?进一步排除故障。 @GaëlMarziou 我在原始帖子中放置了一个链接,其中包含正在发生的事情的完整输出。似乎它确实开始发出很多请求,但最终服务器挂在我身上paste.ubuntu.com/24048741 @GaëlMarziou 似乎 npm install 有效,但 yarn 无效。 npm 看起来它已经实现了重试逻辑,而 yarn 没有“npm info retry 将重试,最后一次尝试出错:错误:连接 ETIMEDOUT 151.101.112.162:443” 你试过github.com/yarnpkg/yarn/issues/944中提到的建议纱线选项--network-concurrency 1吗? 【参考方案1】:

我遇到了同样的错误,在我的情况下,它只是在尝试从 Docker 容器yarn add 时。

重启 Docker 解决了我的问题。

【讨论】:

【参考方案2】:

尝试正确设置注册表,如:

npm config set registry "https://registry.npmjs.org"

【讨论】:

以上是关于无法安装 jhipster-generator的主要内容,如果未能解决你的问题,请参考以下文章

JRE无法安装

关于无法打开此安装程序包

cad软件无法安装如何解决

Chrome浏览器无法打开,安装程序也无法启动不能重新安装,啥原因?

Windows无法完成安装怎么办?

Dreamweaver:无法更新菜单,将不会安装该扩展