Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade from Angular 5.2 to 6.1

Tags:

I am upgrading to Angular 6, but it looks like i get an error when running ng serve or ng build.

I do get the following error

Cannot destructure property 'createHash' of 'undefined' or 'null'. TypeError: Cannot destructure property 'createHash' of 'undefined' or 'null'. at Object. (C:\Users\stian\Source\Repos\minside\src\MinSide.Web\Areas\ClientApp\node_modules\mini-css-extract-plugin\dist\index.js:26:44)

I have been following the update guide https://update.angular.io/

It looks like it is webpack related, but if anyone know how to fix this or has experienced it themselves. Help is appreciated

like image 554
stian64 Avatar asked May 15 '18 11:05

stian64


People also ask

How do I upgrade to the latest version of Angular?

First uninstall the existing Angular cli packages. Then run npm cache verify command to clear the node packages cache. Then install latest Angular CLI version using npm install -g @angular/cli@latest command.

Can we upgrade Angular version?

Upgrade Angular CLI globally The Angular CLI is installed on global level as well as on project level. If you upgrade Angular CLI version inside Angular project then it shall update only project's Angular CLI version. The global Angular CLI version can be upgraded by removing previous version and installing newer one.


1 Answers

You need to update wepback from ^4.1.0 to ^4.3.0 or ^4.4.1

like image 82
Fateme Fazli Avatar answered Sep 27 '22 19:09

Fateme Fazli