Invalid JSON character when running ng serve

前端 未结 7 1647
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:04

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

    0 讨论(0)
  • 2021-02-19 11:10

    I just had the same issue as described while using the "ng g c" command. The issue was that I forgot a comma (,) while adding a second style-sheet to the angular.json file.

    Hope this helps someone, Vlad

    0 讨论(0)
  • 2021-02-19 11:14

    Make sure angular.json encoding in UTF-8 not UTF-8-BOM.

    0 讨论(0)
  • 2021-02-19 11:17

    Its mainly due to the syntax error in angular.json file. make sure there is a comma (,) in every end of the previous line. and also check the slash ( / and \ ) in path. use "/" instead of "\".

    0 讨论(0)
  • 2021-02-19 11:18

    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.

    0 讨论(0)
  • 2021-02-19 11:19

    Looks like you've added a path in the angular.json file with "\" instead of "/".

    0 讨论(0)
提交回复
热议问题