Solvedangular cli I am on Angular 5 and CLI 1.5 and I get an error

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request


Angular CLI: 1.5.0
Node: 9.0.0
OS: linux x64
Angular: 5.0.0
... common, compiler, compiler-cli, core, forms, http
... platform-browser, platform-browser-dynamic, router

@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.0
typescript: 2.4.2
webpack: 3.8.1
node: 9.0.0
npm: 5.5.1

Repro steps.

I just build a webpack program and I get this error with @ngtools

The log given by the failure.

ERROR in ./test/angular-webpack/angular/bundle.aot.ts
Module not found: Error: Can't resolve './module.ngfactory' in '/home/patrikx3/Projects/angular5/corifeus-web5/test/angular-webpack/angular'
 @ ./test/angular-webpack/angular/bundle.aot.ts 8:25-54

ERROR in Error: Please update @angular/cli. Angular 5+ requires at least Angular CLI 1.5+
  at throwNotSupportedError (/home/patrikx3/Projects/angular5/corifeus-builder-angular5/node_modules/@angular/compiler-cli/src/ngtools_api.js:78:11)
  at Function.NgTools_InternalApi_NG_2.codeGen (/home/patrikx3/Projects/angular5/corifeus-builder-angular5/node_modules/@angular/compiler-cli/src/ngtools_api.js:31:15)
  at _donePromise.Promise.resolve.then (/home/patrikx3/Projects/angular5/corifeus-builder-angular5/node_modules/@ngtools/webpack/src/plugin.js:430:58)
  at <anonymous>:null:null
  at process._tickCallback (internal/process/next_tick.js:188:7)
  at Function.Module.runMain (module.js:684:11)
  at startup (bootstrap_node.js:191:16)
  at bootstrap_node.js:613:3

ERROR in /home/patrikx3/Projects/angular5/corifeus-web5/test/angular-webpack/angular/bundle.aot.ts (8,31): Cannot find module './module.ngfactory'.

Desired functionality.

I am on Angular CLI 1.5, why do I get this error that I am not on Angular 1.5???

Mention any other details that might be useful.

20 Answers

✔️Accepted Answer

I faced this error after updating a non-CLI project to Angular 5 and @ngtools/webpack 1.8.0. I forgot to replace AotPlugin with AngularCompilerPlugin in my webpack config as described in the @ngtools/webpack

By using AngularCompilerPlugin the error went away.

Other Answers:

Yes, that's it , now it works!, THANKS!

More Issues: