ERROR in ./node_modules/ng2-smart-table/ng2-smart-table.ngfactory.js

2.2k Views Asked by At

I am getting the below error. when i do "ng build --prod --aot"

ERROR in ./node_modules/ng2-smart-table/ng2-smart-table.ngfactory.js Module not found: Error: Can't resolve '../@akveo/ng2-completer/ng2-completer.ngfactory' in 'C:\Shruthi\Applications\PULSE\Q2-error\pulse\Pulse-web\node_modules\ng2-smart-table'

everything works fine when i do ng build.

I am getting this error from yesterday everything was working fine in before yesterday.

Is it error because of ng2-completer or something related ng build or angular version.

below is my 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"
  }
}

Pleas help me! Not able to figure out the reason

2

There are 2 best solutions below

0
On

If you are using Ang 9

Upgrade these libraries to these versions

"ng2-completer": "^9.0.1",

"ng2-smart-table": "^1.6.0",

"typescript": "3.8.3" // note explicit ie no "~" or "^"

0
On

It seems to be a problem with the library itself. See this: https://github.com/akveo/ng2-smart-table/issues/1143. We are also facing the same problem while upgrading our application to Angular 9.