Invalid JSON character when running ng serve

ng serve invalid json character
node_modules/@angular-cli/lib/config/schema json not found
an unhandled exception occurred: workspace config file cannot be loaded
json validator
notepad++

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

PS F:\Projects\RecipeApp> ng serve
Invalid JSON character: "\"" at 76:13.
Error: Invalid JSON character: "\"" at 76:13.
    at _token (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:63:19)
    at _readArray (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:316:9)
    at _readValue (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:561:22)
    at _readProperty (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:398:19)
    at _readObject (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:431:30)
    at _readValue (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:564:22)
    at _readProperty (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:398:19)
    at _readObject (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:431:30)
    at _readValue (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:564:22)
    at _readProperty (F:\Projects\RecipeApp\node_modules\@angular-devkit\core\src\json\parser.js:398:19)

I am using angular version 6

Check your Angular.json.

It seems that this config file is not correct.

Invalid JSON character when running ng update @angular/cli · Issue , Invalid JSON character when running ng update @angular/cli #10715. Closed. cado1982 opened this issue on May 7, 2018 · 18 comments. Closed  My .angular-cli.json was open in VSCode as a "UTF8 with BOM" encoding, but changing to to be "UTF8" and then running ng update @angular/cli finally worked and upgraded me as expected. For those not familiar, in VSCode on the bottom toolbar on the right is shows the file encoding. Click this to show a menu to change it. 👍

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 as suggested here.

Error : Invalid JSON character, Working with Angular 6 and Node 10. Getting above error while ng serve on C9 online IDE. Error: Invalid JSON character: """ at 25:11. at _token  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.

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

Invalid JSON character: "" at 0:0. when running command "ng , 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. DerekJDev changed the title Problem wit ng serve when angular-cli.json is modified Problem with ng serve when angular-cli.json is modified Feb 7, 2017

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

workspace config file cannot be loaded, invalid JSON character, Please include: commands run (including args), packages added, related code A good way to make a minimal reproduction is to create a new app via ng new /​angular/angular-cli/blob/master/CONTRIBUTING.md#-submitting-an-issue -->  Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

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 "\".

Invalid JSON character: " " at 32:11. after ng add , ng --version _ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _| / △ \ | '_ \ / _` | | | | |/ _` @angular/cdk 8.1.4 @angular/cli 8.3.3 @angular/compiler-cli 7.2.15 @angular/http 7.2.15 npm run serve:ssr : package.json does not exist hot 1. ng update @angular/cli Updating karma configuration Updating configuration Removing old config file (.angular-cli.json) Writing config file (angular.json) Invalid JSON character: "" at 0:0. I can't see how there is a problem at 0:0. The first character in .angular-cli.json is an open bracket {. Is there an encoding issue or something?

angular, Recibo el siguiente error al ejecutar ng serve PS F:\Projects\RecipeApp> ng serve Invalid JSON character: "\"" at 76:13. Error: Invalid JSON character: "\"" at  server.key (private key) server.crt (root certificate) Before we run our application, make sure you have restarted your browser and updated the start script in package.json. "start": "ng serve

angular/cli @ 7.0.5 .. 7.3.9 - Package Diff, Visual diff of the npm package '@angular/cli' comparing 7.0.5 with 7.3.9. run(​options: AddCommandSchema & Arguments): Promise<number | void>;. + private commands/serve.json If the next character is an '=', treat it as a long flag. Angular is a platform for building mobile and desktop web applications. Join the community of millions of developers who build compelling user interfaces with Angular.

error occured Invalid Json, rxjs when Upgrade angular 6.0, 2) When run command ng update @angular/cli and got error 'Invalid JSON character:"" at 0:0. ' then followed below steps: - converting some .json files (​tsconfig,package.json,angular.cli,tslint.json etc.) to UTF8. - run again  Using package manager: 'npm' Collecting installed dependencies Found 40 dependencies. "next" option has no effect when using "migrate-only" option. ** Executing migrations of package '@angular/cli' ** > Update an Angular CLI project to version 9. Invalid JSON character: "{" at 74:32. × Migration failed. See above for further details.

Comments
  • Do you have a full stack trace?
  • Remove node_module folder , run npm install again.
  • please post your error as text, not as an image.
  • I experienced the same problem. It happened after git merge which makes conflict. Just check your angular.json file.
  • You'r Answer could be comment.
  • In this case it´s the answer, because you will get exactly the described error, if you put a "/" at the wrong place in your Angular.json. But, yes, you are right, this could also be a comment to clarify the error description.
  • There was syntax error in my angular.json. I'd added a line to the 'styles' section, but forgot to add a "," on the end of the previous line.
  • 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 "\".