Error thrown during publishing dotnet core app

156 Views Asked by At

I'm trying to publish a dotnet core 2.2 app with angular.

During the publishing I get following error:

Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is "7.2.15"

I've tried to fix the version, running npm install and npm update. But honestly speaking I don't understand what is the problem.

I've tried to publish with following command:

dotnet publish -c Release -r linux-x64

Publish works without error.

2

There are 2 best solutions below

1
Asif Rahman On

Try to update webpack. It solves this issue

npm install --save-dev @ngtools/webpack@latest

I had similer issue with .net core. This link helped me

Update to angular 5 throws Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is 5.1.0

0
RBull On

I've tried to follow your suggestion, but with this fix I got following error "Cannot find module '@angular/compiler-cli/ngcc'". Trying to fix that leads to more and more needed peer dependencies to install by myself.