I have installed the @angular/cli on my MacBook machine. Node server version is v6.9.5 and the npm version is 3.10.10. I have ran the following command to install the @angular/cli.
sudo npm install -g @angular-cli
When I run the ng help command or any command for ng. It shows me the following error
Parsing .angular-cli.json failed. Please make sure your .angular-cli.json is valid JSON. Error: SyntaxError: Unexpected token u in JSON at position 22
InvalidConfigError: Parsing .angular-cli.json failed. Please make sure your
.angular-cli.json is valid JSON.
Error: SyntaxError: Unexpected token u in JSON at position 22
at InvalidConfigError (/usr/local/lib/node_modules/@angular/cli/models/config/config.js:10:9)
at Function.fromConfigPath (/usr/local/lib/node_modules/@angular/cli/models/config/config.js:77:19)
at Function.fromProject (/usr/local/lib/node_modules/@angular/cli/models/config.js:96:46)
at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/commands/build.js:7:35)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
I also uninstalled and @angualr/cli and clear the cache then reinstalled @angualr/cli. I run the following command.
sudo npm uninstall -g @angular-cli
npm cache clean sudo
npm install -g @angular-cli
Still the same issue is appearing.
The package is called @angular/cli, so do npm install -g @angular/cli.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With