Skip to content

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

@AnassL

Description

@AnassL

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions