错误
node_modules/angular-datatables/src/angular-datatables.module.d.ts(8,22) 中的错误:错误 TS-996002:出现在 AppModule 的 NgModule.imports 中,但无法解析为 NgModule 类 node_modules/ ng2-select2/ng2-select2.d.ts(3,22):错误 TS-996002:出现在 AppModule 的 NgModule.imports 中,但无法解析为 NgModule 类
吴版
Angular CLI: 8.0.3
Node: 12.4.0
OS: win32 x64
Angular: 8.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router, service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.800.3
@angular-devkit/build-angular 0.800.3
@angular-devkit/build-optimizer 0.800.3
@angular-devkit/build-webpack 0.800.3
@angular-devkit/core 8.0.3
@angular-devkit/schematics 8.0.3
@angular/cli 8.0.3
@angular/http 7.2.15
@angular/pwa 0.800.3
@ngtools/webpack 8.0.3
@schematics/angular 8.0.3
@schematics/update 0.800.3 (cli-only)
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0
参考 https://angular.io/guide/ivy
Angular.json
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"aot": true,
tsconfig.app.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"angularCompilerOptions": {
"enableIvy": true
},
通过将标志设置为假工作
"angularCompilerOptions": {
"enableIvy": false
},
问题
- 整合常春藤错误后重现。
试图删除节点模块
在配置文件中删除常春藤时,ng serve 工作正常。
欢迎任何建议