Everything was working smoothly, but suddenly I encountered this error message while running ng serve. I haven't made any recent upgrades or changes to dependencies.
Could someone please provide guidance on how to resolve this issue?
ERROR in Error: NgModule is not an NgModule
at _getNgModuleMetadata (E:\Going-on\czc-admin-startupui\node_modules\@angular\compiler-cli\src\ngtools_impl.js:140:15)
at _extractLazyRoutesFromStaticModule (E:\Going-on\czc-admin-startupui\node_modules\@angular\compiler-cli\src\ngtools_impl.js:109:26)
at E:\Going-on\czc-admin-startupui\node_modules\@angular\compiler-cli\src\ngtools_impl.js:129:27
at Array.reduce (native)
at _extractLazyRoutesFromStaticModule (E:\Going-on\czc-admin-startupui\node_modules\@angular\compiler-cli\src\ngtools_impl.js:128:10)
at includeLazyRouteAndSubRoutes (E:\Going-on\czc-admin-startupui\node_modules\@angular\compiler-cli\src\ngtools_impl.js:66:25)
at Array.reduce (native)
at includeLazyRouteAndSubRoutes (E:\Going-on\czc-admin-startupui\node_modules\@angular\compiler-cli\src\ngtools_impl.js:67:26)
at Array.reduce (native)
at Object.listLazyRoutesOfModule (E:\Going-on\czc-admin-startupui\node_modules\@angular\compiler-cli\src\ngtools_impl.js:54:36)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (E:\Going-on\czc-admin-startupui\node_modules\@angular\compiler-cli\src\ngtools_api.js:91:39)
at AotPlugin._getLazyRoutesFromNgtools (E:\Going-on\czc-admin-startupui\node_modules\@ngtools\webpack\src\plugin.js:207:44)
at _donePromise.Promise.resolve.then.then.then.then.then (E:\Going-on\czc-admin-startupui\node_modules\@ngtools\webpack\src\plugin.js:443:24)
at process._tickCallback (internal/process/next_tick.js:109:7)
webpack: Failed to compile.
Below is the content of my package.json file:
{
"name": "sb-admin-angular4-bootstrap4",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --ec=true",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.4.3",
"@angular/cli": "^1.4.3",
"@angular/common": "^4.4.3",
"@angular/compiler": "^4.4.3",
"@angular/compiler-cli": "^4.4.3",
"@angular/core": "^4.4.3",
"@angular/forms": "^4.4.3",
"@angular/http": "^4.4.3",
"@angular/platform-browser": "^4.4.3",
"@angular/platform-browser-dynamic": "^4.4.3",
"@angular/platform-server": "^4.4.3",
"@angular/router": "^4.4.3",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.25",
"@ngx-translate/core": "^6.0.1",
"@ngx-translate/http-loader": "0.0.3",
"@swimlane/ngx-datatable": "^9.3.0",
"angular2-datatable": "^0.6.0",
"angular2-multiselect-dropdown": "^1.2.2",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"ionicons": "^3.0.0",
"ng-block-ui": "^1.0.0-beta.15",
"ng-spin-kit": "^5.1.1",
"ng2-charts": "^1.5.0",
"rxjs": "^5.1.0",
"typescript": "^2.3.4",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "^1.4.3",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
I have tried uninstalling, reinstalling, and attempting again without success. I also attempted using the latest TypeScript versions, but encountered different errors so I reverted those changes.