Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid JSON character: "" at 0:0. when running command "ng update @angular/cli --migrate-only --from=1.7.4"

I have cloned a project from github and am trying to run it locally, it seems that the .angular-cli.json file needs to be updated, I have ran through some of the tutorials here on how to do that and am faced with this error.

ng update @angular/cli --migrate-only --from=1.7.4 Updating karma configuration Updating configuration Removing old config file (.angular-cli.json) Writing config file (angular.json) Invalid JSON character: "" at 0:0.

like image 338
Russell Avatar asked Oct 24 '25 00:10

Russell


1 Answers

It seems that you are trying to upgrade angular core version for your cloned project. Any way this error happens due to json files wrong encoding so you must ensure that all your json files like (angular-cli.json, tslint.json and tsconfig.json) are UTF-8 encoded not UTF With BOM. You can change encoding of these files using VSCode or notepad++ so running ng update @angular/cli --migrate-only --from=1.7.4 should wrong smoothly without any problems

like image 79
Ramy El-Basyouni Avatar answered Oct 26 '25 16:10

Ramy El-Basyouni