0

我收到以下错误。当我执行“ng build --prod --aot”时

./node_modules/ng2-smart-table/ng2-smart-table.ngfactory.js 中的错误 找不到模块:错误:无法解析 '../@akveo/ng2-completer/ng2-completer.ngfactory' in ' C:\Shruthi\Applications\PULSE\Q2-error\pulse\Pulse-web\node_modules\ng2-smart-table'

当我进行构建时,一切正常。

我从昨天开始收到此错误,昨天之前一切正常。

是因为 ng2-completer 还是与 ng build 或 Angular 版本相关的东西而导致的错误。

下面是我的 package.json

{
  "name": "pulse-web",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "compodoc": "compodoc",
    "generate-docs": "compodoc -p src/tsconfig.app.json",
    "serve-docs": "compodoc -s src/tsconfig.app.json"
  },
  "private": true,
  "dependencies": {
    "@akveo/ng2-completer": "^9.0.1",
    "@amcharts/amcharts4": "^4.9.6",
    "@angular/animations": "~7.2.0",
    "@angular/cdk": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/http": "^7.2.16",
    "@angular/material": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "@compodoc/compodoc": "^1.1.11",
    "@mc-dxp/dxp-styles": "^3.2.1",
    "@mc-dxp/dxp-web": "^4.1.1",
    "@ng-bootstrap/ng-bootstrap": "^4.1.5",
    "@syncfusion/ej2-angular-buttons": "^17.4.49",
    "@syncfusion/ej2-angular-lists": "^17.4.47",
    "@syncfusion/ej2-angular-navigations": "^17.4.49",
    "@types/crypto-js": "^3.1.43",
    "acorn": "^6.1.1",
    "bootstrap": "^4.4.1",
    "core-js": "^2.5.4",
    "jquery": "^3.4.1",
    "jw-angular-pagination": "^1.1.0",
    "moment": "^2.24.0",
    "ng2-completer": "^2.0.8",
    "ng2-smart-table": "^1.5.0",
    "ngx-bootstrap": "^5.3.2",
    "ngx-cookie-service": "^2.3.0",
    "ngx-select-dropdown": "1.3.0",
    "popper.js": "^1.16.1",
    "rxjs": "~6.3.3",
    "rxjs-compat": "^6.5.4",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.8",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@types/node": "~8.9.4",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.2.2"
  }
}

请帮助我!无法弄清楚原因

4

2 回答 2

0

这似乎是图书馆本身的问题。请参阅:https ://github.com/akveo/ng2-smart-table/issues/1143 。在将应用程序升级到 Angular 9 时,我们也面临同样的问题。

于 2020-04-23T08:58:24.073 回答
0

如果您使用的是 Ang 9

将这些库升级到这些版本

"ng2-completer": "^9.0.1",

"ng2-智能表": "^1.6.0",

"typescript": "3.8.3" // 注意明确,即没有 "~" 或 "^"

于 2020-12-02T02:31:44.597 回答