Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng generate component giving error "Unexpected token / in JSON at position 629"

Tags:

angular-cli

I just cloned an angular 6 project from bitbucket, did npm install and all the related tasks, it seems to be working well, but when I try to generate a new component using the angular-cli tool "ng generate component", I get the error

"Unexpected token / in JSON at position 629"

How can I fix this?

like image 278
Larry Avatar asked May 09 '18 16:05

Larry


2 Answers

Check if you accidentally made a comment. Open up angular.json and look for '/' on the line or 'position' specified. JSON does not support comments.

like image 157
Chloe Corrigan Avatar answered Oct 06 '22 11:10

Chloe Corrigan


I also had same problem, when I trying to create component and after googling, I found https://jsonlint.com/ and which validate your JSON files and it points to the exact line and error.

For more information, please refer to following thread: https://github.com/angular/angular-cli/issues/10880

Cheers!

like image 7
Sudhir Avatar answered Oct 06 '22 13:10

Sudhir