Invalid JSON character when running ng serve

前端 未结 7 1667
Happy的楠姐
Happy的楠姐 2021-02-19 11:02

I am getting following error when running ng serve...

PS F:\\Projects\\RecipeApp> ng serve
Invalid JSON character: \"\\\"\" at 76:13.
Error: Invalid JSON char         


        
7条回答
  •  無奈伤痛
    2021-02-19 11:20

    In my case the problem was Visual Studio 2017 adding UTF-8 BOM characters to angular.json after I edited the file.

    Permanent solution for Visual Studio and Angular CLI was to open the file once and save as UTF-8 without signature

    1. Go to File -> Save As.

    1. Then on Save button click on triangle and click Save with Encoding....

    1. From Encodings dropdown select UTF-8 Without signature -> Click OK.

提交回复
热议问题