在使用 Angular 7 应用程序时,在使用构建时遇到以下错误
ng build --configuration=dev
正如在异常中看到的那样,NgxMatDrpModule 前面有一个单引号。尝试删除 node_modules、package-lock.json 并重新安装节点模块,但仍然无法解决问题。有人可以帮忙吗?
环境:
"dependencies": {
"@angular/animations": "^7.2.15",
"@angular/cdk": "^7.3.7",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/http": "^7.2.14",
"@angular/material": "^7.3.7",
"ngx-mat-daterange-picker": "^1.1.5",
}
"devDependencies": {
"@angular-devkit/build-angular": "~0.13.0",
"@angular/cli": "~7.3.0",
"@angular/compiler-cli": "~7.2.0",
}
错误:模块导入的意外值“node_modules/ngx-mat-daterange-picker/ngx-mat-daterange-picker.d.ts 中的 NgxMatDrpModule”。请添加 @NgModule 注释。node_modules/ngx-mat-daterange-picker/node_modules/@angular/cdk/coercion/array.d.ts(10,60): 错误 TS1005: ',' 预期。node_modules/ngx-mat-daterange-picker/node_modules/@angular/cdk/coercion/array.d.ts(10,61): 错误 TS1005: ',' 预期。node_modules/ngx-mat-daterange-picker/node_modules/@angular/cdk/coercion/array.d.ts(10,75): error TS1144: '{' or ';' 预期的。node_modules/ngx-mat-daterange-picker/node_modules/@angular/cdk/coercion/array.d.ts(10,77):错误 TS1011:元素访问表达式应该带一个参数。