-
Notifications
You must be signed in to change notification settings - Fork 12k
Invalid JSON character when running ng update @angular/cli #10715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have the same issue as mentioned over at #10396 |
Same here |
@YoannBureau @Swellenator I managed to get this fixed. I simply opened my .angular-cli.json file in notepad++ and clicked Convert to UTF-8 from the Encoding menu before saving the file. Running ng update @angular/cli now works as expected. There must have been a hidden BOM at the start of the file. |
I was having the same problem but removing the bom didn't solve it. |
@cado1982's answer worked for me! My 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. |
@martindevos I fixed the issue by converting some more .json files (tsconfig, etc.) to UTF8. |
@cado1982 |
After converting all of my .json files to UTF8 (without BOM) as Tom suggested, it finally worked. Thanks alot ! |
It would however be nice when angular-cli shows the file with the JSON error :) |
I got the same error with ng g library. I didn't had any encoding issues, however I had one excessive comma in tsconfig.json, which made it invalid json. |
I got the same problem, and I try everything and it dont work yet :-(
|
I had the same issue |
I'll second Ventyz's comment, ng g lib seems to add an additional entry for package_name/* which I keep removing when I generate new libraries, make sure the last element isn't trailing with an extra comma. |
I had the same as @FrankiePo , I just got a comma at the end of an object in tsconfig.json. |
@Swellenator 's solution worked for me. |
@ChrisMBarr I have tried everything you mentioned, i cross checked all the files ( angular.json, package.json, tsconfig.json, tslint.json etc ) for their encoding at the right bottom of the VS Code, they all are in UTF-8 format and i could not see any other way to fix this issue. I am trying to migrate my angular application from angular 6 to angular 7, and when i try executing following command in the terminal, i get below error Command: Error: |
same here ! :) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Repro steps
Observed behavior
Desired behavior
Configuration should be migrated to the new angular.json format. If there is a problem, an understandable error message should be shown.
Mention any other details that might be useful (optional)
.angular-cli.json
The text was updated successfully, but these errors were encountered: