gpt4 book ai didi

jhipster - 在生成的 JHipster 应用程序上设置 ng-jhipster

转载 作者:行者123 更新时间:2023-12-02 08:10:58 37 4
gpt4 key购买 nike

我想将克隆的 ng-jhipster 项目配置为生成的 JHipster 应用程序的依赖项。

我正在使用以下版本(来自 jhipster 信息):

git version 2.15.0  
node: v6.11.5
npm: 5.4.2
yarn: 1.2.1
yeoman: 2.0.0

对于我新生成的 JHipster 应用程序,我正在执行以下步骤:
yarn global add generator-jhipster(我得到 v4.10.2)
mkdir ~/v4.10.2
cd ~/myNewGeneratedApp
jhipster:这里我选择所有默认值(特别是 Angular 4)
(yarn install 自动执行,一切正常)
然后我运行 yarn start 一切开始顺利。

对于我的 ng-jhipster,我正在执行以下步骤:
cd ~
git clone https://github.com/jhipster/ng-jhipster
cd ng-jhipster
git checkout v0.2.12(使用来自 myNewGeneratedApp 的“相同”依赖版本)

现在我正在阅读 ng-jhipster wiki 并运行:

yarn install
yarn run test
yarn run build
yarn link

我回到 myNewGeneratedApp 文件夹:

cd ~/myNewGeneratedApp 
yarn link ng-jhipster

所以在 ~/myNewGeneratedApp/node_modules 中,文件夹 ng-jhipster 很好地链接到我本地的 ng-jhipster 项目。

现在当我运行 yarn start 时出现以下错误:

ERROR in [at-loader] ./src/main/webapp/app/blocks/interceptor/auth-expired.interceptor.ts:7:14
TS2415: Class 'AuthExpiredInterceptor' incorrectly extends base class 'JhiHttpInterceptor'.
Types of property 'requestIntercept' are incompatible.
Type '(options?: RequestOptionsArgs) => RequestOptionsArgs' is not assignable to type '(options?: RequestOptionsArgs) => RequestOptionsArgs'. Two different types with this name exist, but they are unrelated.
Types of parameters 'options' and 'options' are incompatible.
Type 'RequestOptionsArgs' is not assignable to type 'RequestOptionsArgs'. Two different types with this name exist, but they are unrelated.

ERROR in [at-loader] ./src/main/webapp/app/blocks/interceptor/auth.interceptor.ts:6:14
TS2415: Class 'AuthInterceptor' incorrectly extends base class 'JhiHttpInterceptor'.
Types of property 'requestIntercept' are incompatible.
Type '(options?: RequestOptionsArgs) => RequestOptionsArgs' is not assignable to type '(options?: RequestOptionsArgs) => RequestOptionsArgs'. Two different types with this name exist, but they are unrelated.
Types of parameters 'options' and 'options' are incompatible.
Type 'RequestOptionsArgs' is not assignable to type 'RequestOptionsArgs'. Two different types with this name exist, but they are unrelated.

ERROR in [at-loader] ./src/main/webapp/app/blocks/interceptor/errorhandler.interceptor.ts:5:14
TS2415: Class 'ErrorHandlerInterceptor' incorrectly extends base class 'JhiHttpInterceptor'.
Types of property 'requestIntercept' are incompatible.
Type '(options?: RequestOptionsArgs) => RequestOptionsArgs' is not assignable to type '(options?: RequestOptionsArgs) => RequestOptionsArgs'. Two different types with this name exist, but they are unrelated.
Types of parameters 'options' and 'options' are incompatible.
Type 'RequestOptionsArgs' is not assignable to type 'RequestOptionsArgs'. Two different types with this name exist, but they are unrelated.

ERROR in [at-loader] ./src/main/webapp/app/blocks/interceptor/http.provider.ts:20:9
TS2345: Argument of type 'XHRBackend' is not assignable to parameter of type 'ConnectionBackend'.
Types of property 'createConnection' are incompatible.
Type '(request: Request) => XHRConnection' is not assignable to type '(request: any) => Connection'.
Type 'XHRConnection' is not assignable to type 'Connection'.
Types of property 'request' are incompatible.
Type 'Request' is not assignable to type 'Request'. Two different types with this name exist, but they are unrelated.
Types of property 'headers' are incompatible.
Type 'Headers' is not assignable to type 'Headers'. Two different types with this name exist, but they are unrelated.
Types have separate declarations of a private property 'mayBeSetNormalizedName'.

ERROR in [at-loader] ./src/main/webapp/app/blocks/interceptor/notification.interceptor.ts:6:14
TS2415: Class 'NotificationInterceptor' incorrectly extends base class 'JhiHttpInterceptor'.
Types of property 'requestIntercept' are incompatible.
Type '(options?: RequestOptionsArgs) => RequestOptionsArgs' is not assignable to type '(options?: RequestOptionsArgs) => RequestOptionsArgs'. Two different types with this name exist, but they are unrelated.
Types of parameters 'options' and 'options' are incompatible.
Type 'RequestOptionsArgs' is not assignable to type 'RequestOptionsArgs'. Two different types with this name exist, but they are unrelated.
Types of property 'headers' are incompatible.
Type 'Headers' is not assignable to type 'Headers'. Two different types with this name exist, but they are unrelated.
Types have separate declarations of a private property 'mayBeSetNormalizedName'.

ERROR in [at-loader] ./src/main/webapp/app/shared/alert/alert-error.component.ts:25:9
TS90010: Type 'Subscription' is not assignable to type 'Subscription'. Two different types with this name exist, but they are unrelated.
Property '_parent' is protected but type 'Subscription' is not a class derived from 'Subscription'.

ERROR in [at-loader] ./src/main/webapp/app/shared/alert/alert-error.component.ts:86:39
TS2345: Argument of type 'Subscription' is not assignable to parameter of type 'Subscription'.
Property '_parent' is protected but type 'Subscription' is not a class derived from 'Subscription'.

如果我通过以下操作“恢复”此步骤:
yarn 添加 ng-jhipster
yarn start -> 一切正常(使用真正的 NPM 依赖)

我注意到本地链接的 ng-jhipster 和 yarn 从 NPM 仓库获取的有一些区别:使用本地链接的项目:
- node_modules 文件夹存在于 myNewGeneratedApp/node_modules/ng-jhipster
- 没有“.js”文件。 (尚未执行 typescript 转译)
- 所以仍然有 *.ts 文件

我不知道这是否异常,但是 NPM 存储库的依赖性(运行良好)与上述几点不同(至少)。
也许 ng-jhipster 的 release 脚本也需要运行(?)。 (对于 npm run ngcnpm publish 步骤?)
我错过了这个过程吗?也许 wiki 中只缺少一个步骤?

它与这个问题有某种关系:ng-jhipster development creates compilation errors .所描述的步骤对我不起作用。

感谢您的帮助!

最佳答案

在此处查看 ng-jhipster 项目中的自述文件:https://github.com/jhipster/ng-jhipster/blob/master/README.md

关于jhipster - 在生成的 JHipster 应用程序上设置 ng-jhipster,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47085623/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com