1

I tried to update my angular 9 to 10. It shows this error

C:\Users\chalani>ng update @angular/cdk --next
The installed local Angular CLI version is older than the latest pre-release version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Unknown error: Error: No valid exports main found for 'C:\Users\chalani\AppData\Local\Temp\angular-cli-packages-BuVCKr\node_modules\@angular\cli\node_modules\uuid'

Meanwhile I had a project from angular 8. So I tried to update it too. There also comes this error

H:\Chale\ANGULAR\certistore>ng update
The installed Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Unknown error: Error: No valid exports main found for 'C:\Users\chalani\AppData\Local\Temp\.ng-temp-packages-jMRO8x\node_modules\@angular\cli\node_modules\uuid'

How can I update my angular to newest?

Kamalka Fernando
  • 153
  • 1
  • 2
  • 13
  • @JohnPeters what should do? I deleted local node_modules but still the same. How can I uninstall global node_modules? – Kamalka Fernando Jun 30 '20 at 01:02
  • Now ng serve also isn't work. It is comming the above error line ```Unknown error: Error: No valid exports main found for 'C:\Users\chalani\AppData\Local\Temp\.ng-temp-packages-jMRO8x\node_modules\@angular\cli\node_modules\uuid' ``` – Kamalka Fernando Jun 30 '20 at 02:36
  • That means you need to run npm i @angular\cli – JWP Jun 30 '20 at 07:49

1 Answers1

1

I had the same issue. Upgrading to node 14.x resolved the issue for me. Here is an instruction on how to upgrade node: https://stackoverflow.com/a/11298299/6405287

Skillz
  • 308
  • 4
  • 10