Angular-cli: Error: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "5.1.0"

Created on 8 Dec 2017  路  5Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 1.6.0
Node: 9.2.0
OS: win32 x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

@angular/cli: 1.6.0
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.5.0
@schematics/angular: 0.1.10
typescript: 2.4.2
webpack-hot-middleware: 2.18.2
webpack-merge: 4.1.0
webpack: 2.5.1

Windows 10

Observed behavior

After updating CLI from 1.5 to 1.6

From Visual Studio 2017 (v15.4.5), the following error prevents the application from starting, pointing to the following snippet in the startup.cs file:

                app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
                {
                    HotModuleReplacement = true
                });

The Exception shows the following:

System.AggregateException occurred
  HResult=0x80131500
  Message=One or more errors occurred. (Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "5.1.0".
Error: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "5.1.0".
    at Object.<anonymous> (D:\AppS\Angular5Core2\node_modules\@ngtools\webpack\src\index.js:27:11)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (E:\_a\AppS\Angular5Core2\webpack.config.js:4:19)
    at Module._compile (module.js:641:30))
  Source=<Cannot evaluate the exception source>
  StackTrace:
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.AspNetCore.Builder.WebpackDevMiddleware.UseWebpackDevMiddleware(IApplicationBuilder appBuilder, WebpackDevMiddlewareOptions options)
   at Angular5Core2.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in D:\AppS\Angular5Core2\Startup.cs:line 34

Inner Exception 1:
NodeInvocationException: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "5.1.0".
Error: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "5.1.0".
    at Object.<anonymous> (D:\AppS\Angular5Core2\node_modules\@ngtools\webpack\src\index.js:27:11)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\AppS\Angular5Core2\webpack.config.js:4:19)
    at Module._compile (module.js:641:30)

I have no .angular-cli.json file installed in the root of the project.

Most helpful comment

You're using an old version of @ngtools/webpack. Could you try upgrade your @ngtools/webpack package to the latest 1.9.0 version?

Closing this as working as intended. The 1.5.0 version was not tested with Angular 5.

All 5 comments

You're using an old version of @ngtools/webpack. Could you try upgrade your @ngtools/webpack package to the latest 1.9.0 version?

Closing this as working as intended. The 1.5.0 version was not tested with Angular 5.

Thank you @hansl , it Worked after updated @ngtools/webpack to 1.9.0 version.

running "webpack": "2.5.1", "webpack-hot-middleware": "2.18.2", and this still doesn't help

Essentially same message: "Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is '6.1.7'" I have updated "@ngtools/webpack": "6.2.1" as well as trying to update all other packages. No success.

Looking in the reference npm packages, the @angular/compiler-cli shows a delta with "minimmist - not installed: and below it "tsickle" also shows a delta "minimist - not installed". Likely that is the problem? I tried installing this but wasn't successful.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rwillmer picture rwillmer  路  3Comments

5amfung picture 5amfung  路  3Comments

hartjo picture hartjo  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments