Invalid JSON character when running ng serve

Check your Angular.json.

It seems that this config file is not correct.


Update for clarification:
A misplaced "/" in the angular.json will create exactly that kind of error.


Open the file in Notepad++ and change the encoding to UTF-8 then save it will work for sure :)


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.

FileSaveAs

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

SaveAsPopUp

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

AdvancedSaveOptions