Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@angular/cli not working after installation

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.

like image 523
Muhamamd Omar Muneer Avatar asked May 03 '26 06:05

Muhamamd Omar Muneer


1 Answers

The package is called @angular/cli, so do npm install -g @angular/cli.

like image 164
Vladimir Zdenek Avatar answered May 05 '26 20:05

Vladimir Zdenek