Node.js 无法安装formly";无法读取属性';种类';“未定义”的定义;
这个问题看起来很愚蠢,但就像两周前一样,我在安装它时没有遇到任何问题。 现在看起来是这样的: ng add@ngx formly/schematics--ui主题=材料 我尝试在material和cdk模块之后/之前安装它,但结果是一样的。 我还尝试安装所有单独的formly模块(基于我之前创建的项目),但我遇到了以下错误:Node.js 无法安装formly";无法读取属性';种类';“未定义”的定义;,node.js,angular,node-modules,yarnpkg,angular-formly,Node.js,Angular,Node Modules,Yarnpkg,Angular Formly,这个问题看起来很愚蠢,但就像两周前一样,我在安装它时没有遇到任何问题。 现在看起来是这样的: ng add@ngx formly/schematics--ui主题=材料 我尝试在material和cdk模块之后/之前安装它,但结果是一样的。 我还尝试安装所有单独的formly模块(基于我之前创建的项目),但我遇到了以下错误: The package that you are trying to add does not support schematics. You can try using
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.
我还试图删除节点模块和Thread.lock并再次初始化它,但仍然不起作用。
而且,当我创建表单时,它不会显示出来。
我还试图安装它与纱线添加。。。
或者-ui-theme=bootstrap,但结果是相同的。
在安装它之前也尝试过ng服务(在堆栈上的某个地方阅读),但它也不起作用
我听说node v.15.6.0存在一些问题,但我不确定是否是这样。
以下是我的版本:
npm uninstall @schematics/angular
npm install @schematics/angular@9.1.0
纱线版本为1.22.5
更新:
我尝试用最新的纱线升级来升级所有的软件包,然后重新安装。
及之后:
ng add @ngx-formly/schematics --ui-theme=material
我明白了:
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.
好的,我找到了解决办法。我不得不将角度示意图降级到以前的版本(为了安全起见,我降级了两个版本):
因此,formly schematics与angular 11 schematics不兼容。我使用angular 11并尝试运行“ng add ngx bootstrap”时也遇到了同样的问题