My Joomla
Wizards Unlimited
  • Home
  • Public Speaking
  • Categories
  • Sitemap
  • Login
  • FrontEnd
  • Javascript

Dealing with the error 'Could not find an NgModule' after upgrading from angular 5 to 6.

Details
Written by: Eric Naujock
Category: Angular
Published: 05 July 2018
Hits: 3965
  • NgModule
  • errors
  • Angular

Recently I have been upgrading my projects from Angular 5 to 6. After following the upgrade advice from the Angular Update site, I found that while the project would build, compile, deploy, and lint I could not add new components to my projects. I followed a number of StackExchange and Github articles and found that using the most recent version of Angular 6.0.8. This article had my solution. 

In testing, you can also try to add a component with the following command.

 ng generate component test2 --project {{projectName}}

In summary, my solution was I has to delete the following snippet from my angular.json file. 

 

"angular-e2e": {
  "root": "",
  "sourceRoot": "e2e",
  "projectType": "application",
  "architect": {
    "e2e": {
      "builder": "@angular-devkit/build-angular:protractor",
      "options": {
      "protractorConfig": "./protractor.conf.js",
      "devServerTarget": "angular:serve"
    }
  },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": [
          "e2e/tsconfig.e2e.json"
        ],
        "exclude": [
          "**/node_modules/**"
        ]
      }
    }
  }
}

Assuming your project is named angular this may be a quick fix. If your project is named something other than angular then you will need to look for your project name - e2e section.

Feed Entries

Wizards Unlimited is proud to host with A2Hosting. 

A2 Hosting Offers super fast Http2 hosting with fast speed and awesome service. Wizards Unlimited has been with A2 Hosting and has numerous clients using A2Hosting.