-1

Installed Node JS version 12.19.0 for my Windows 10 64 bit machine and the npm default version was 6.14.8

Installed angular cli using the command npm install -g @angular/cli

When i try any ng command from the command prompt it returns the error message

Unknown Error : Error : Invalid JSON character: "a" at 0:0

i followed the solution in the link Invalid JSON character when running ng serve and converted the angular.json file encoding to UTF-8 using Notepad++ and having the path of ng in the environment variables i.e., C:\Users<username>\AppData\Roaming\npm\node_modules@angular\cli\bin

I have an angular.json file in my users folder and it starts with angular.json text. I know the issue is in that file , but i don't know how to fix it.

I have the npm and nodejs path variables in place. Nothing seems to fix this issue.

2 Answers2

0

Deleted the angular.json in my users/ folder and that did the trick for me. As Abedin.Zhuniqi suggested, i think you cannot have more than one angular.json files in your system

  • Nope as the official documentation from Angular tells us. `The application builder uses the webpack build tool, with default configuration options specified in the workspace configuration file (angular.json) or with a named alternative configuration`. – Abedin.Zhuniqi Oct 22 '20 at 07:11
0

You cannot have two angular.json because when the project has it own angular.json Change the name of it or delete it.

Ruben Helsloot
  • 10,555
  • 5
  • 17
  • 36
Abedin.Zhuniqi
  • 680
  • 3
  • 17
  • 31