gpt4 book ai didi

angular - 运行 'Cannot read property ' 时 Nativescript 错误 'ng generate component' 种类“未定义”

转载 作者:行者123 更新时间:2023-12-03 16:01:29 28 4
gpt4 key购买 nike

当我执行 ng generate component faqs 时,我无法将新组件添加到我的 Nativescript 项目中它返回错误:

Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Cannot read property 'kind' of undefined
或者如果我像 ng generate component 一样运行它它问我组件名称
? What name would you like to use for the component? faqs
并返回
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Cannot read property 'match' of undefined
我在用:
Nativescript 7.0.10

Angular CLI: 10.1.4
Node: 12.18.4
OS: win32 x64

Angular: 10.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package Version
------------------------------------------------------
@angular-devkit/architect 0.1001.4
@angular-devkit/core 10.0.8
@angular-devkit/schematics 10.1.4
@ngtools/webpack 10.1.4
@schematics/angular 10.1.4
@schematics/update 0.1001.4
rxjs 6.6.3
typescript 3.9.7
我只是运行:
tns create HelloWorld
npm i --save-dev @angular/cli
npm install --save-dev @nativescript/schematics
npm install --save-dev @schematics/angular

最佳答案

根据 https://github.com/NativeScript/nativescript-schematics/issues/302解决方案/解决方法是将 typescript 更新到版本 4,即运行

npm install --save-dev typescript@4
我测试了以下步骤,它似乎有效:
npm i -g @nativescript/schematics
ng new -c=@nativescript/schematics my-project --shared
cd my-project
npm install --save-dev typescript@4
ng g component bla

关于angular - 运行 'Cannot read property ' 时 Nativescript 错误 'ng generate component' 种类“未定义”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64236189/

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