首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Cannot install formly“无法读取未定义的属性'kind‘”

Cannot install formly“无法读取未定义的属性'kind‘”
EN

Stack Overflow用户
提问于 2021-01-26 09:01:59
回答 1查看 381关注 0票数 4

这个问题可能看起来很愚蠢,但就像两周前一样,我在安装它时没有任何问题。现在看起来是这样的:

ng add @ngx-formly/schematics --ui-theme=material

我尝试在material和cdk模块之前/之后安装它,但结果是相同的。我还尝试安装所有独立的formly模块(基于我之前创建的项目),得到以下错误:

代码语言:javascript
复制
The package that you are trying to add does not support schematics. You can try using a different version of the package or contact the package author to add ng-add support.

我还尝试删除节点模块和yarn.lock,并再次初始化它,但仍然不起作用。而且,当我创建表单时,它也没有显示出来。我也试着用yarn add安装它。或者-ui-主题=bootstrap,但结果是相同的。在安装它之前,我也尝试过ng serve (在堆栈上的某个地方读到它),但它也不能工作。

我听说node v.15.6.0有一些问题,但我不确定是不是这样。下面是我的版本:

纱线版本为1.22.5

更新:我尝试用yarn Update --latest升级所有的包,然后再次正式安装。在此之后:

代码语言:javascript
复制
 ng add @ngx-formly/schematics --ui-theme=material

我明白了:

代码语言:javascript
复制
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/config'
Require stack:
- /home/wiktor/angular-material-template/node_modules/@ngx-formly/schematics/utils/ast.js
- /home/wiktor/angular-material-template/node_modules/@ngx-formly/schematics/src/ng-add/index.js
- /home/wiktor/angular-material-template/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /home/wiktor/angular-material-template/node_modules/@angular-devkit/schematics/tools/index.js
- /home/wiktor/angular-material-template/node_modules/@angular/cli/utilities/json-schema.js
- /home/wiktor/angular-material-template/node_modules/@angular/cli/models/command-runner.js
- /home/wiktor/angular-material-template/node_modules/@angular/cli/lib/cli/index.js
- /usr/lib/node_modules/@angular/cli/lib/init.js
- /usr/lib/node_modules/@angular/cli/bin/ng
See "/tmp/ng-rRKl9j/angular-errors.log" for further details.
EN

回答 1

Stack Overflow用户

发布于 2021-01-26 09:34:25

好了,我找到解决方案了。我不得不将angular schematics降级到以前的版本(为了安全起见,我降级了两个版本):

代码语言:javascript
复制
npm uninstall @schematics/angular
npm install @schematics/angular@9.1.0

因此,formly schematics与angular 11 schematics不兼容。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65894531

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档