Just wanted to share something that happened to me and took away 5 hours of my life. Hopefully that will help someone else avoid the headache.
Trying to run
npm run start-android-bundle fails with the following error:
ERROR in ./main.aot.ts Module not found: Error: Can't resolve './app.module.ngfactory' in '/path/to/app' @ ./main.aot.ts 5:29-62
No other error, no nothing.
I’ve stumbled upon this thread: https://github.com/angular/angular-cli/issues/4551 on the angular-cli github repository. This stated a problem with the latest version of one of the dependencies of Angular’s AOT, named
enhanced-resolve. Turns out it should be downgraded to version 3.3.0 for everything to work again.
So… to solve the problem, open
package.json and add the next line inside
Hope it helps!