Wik*_*awa 5 node.js node-modules angular-formly yarnpkg angular
这个问题可能看起来很愚蠢,但就像两周前一样,我安装它没有任何问题。现在看起来是这样的:

ng 添加@ngx-formly/schematics --ui-theme=material
我尝试在材料和 cdk 模块之后/之前安装它,但结果是相同的。我还尝试安装所有单独的正式模块(基于我之前创建的项目),但出现此错误:
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.
Run Code Online (Sandbox Code Playgroud)
我还尝试删除节点模块和yarn.lock并再次初始化它,但仍然不起作用。而且当我创建表单时它也不会显示。我也尝试用yarn add ...或-ui-theme=bootstrap来安装它,但结果是一样的。在安装之前也尝试过服务(在堆栈上的某个地方读取它),但它也不起作用。
我听说节点 v.15.6.0 有一些问题,但我不确定是否是这样。这也是我的版本:
纱线版本是 1.22.5
更新:我尝试使用纱线升级--最新升级所有软件包,然后再次正式安装。之后:
ng add @ngx-formly/schematics --ui-theme=material
Run Code Online (Sandbox Code Playgroud)
我明白了:
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.
Run Code Online (Sandbox Code Playgroud)
好的,我找到了解决方案。我不得不将角度原理图降级到以前的版本(为了安全起见,我降级了两个版本):
npm uninstall @schematics/angular
npm install @schematics/angular@9.1.0
Run Code Online (Sandbox Code Playgroud)
因此,formly 原理图与 Angular 11 原理图不兼容。
| 归档时间: |
|
| 查看次数: |
718 次 |
| 最近记录: |