@ angular / cli doesn't work after installation

I have installed @ angular / cli on my MacBook computer. Node server version is v6.9.5 and npm version is 3.10.10. I ran the following command to install @ angular / cli.

sudo npm install -g @ angular-cli

When I run ng help command or any command for ng. This 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 both @ angualr / cli and cleared the cache and then installed @ angualr / cli again. I am running the following command.

sudo npm uninstall -g @angular-cli 
npm cache clean sudo 
npm install -g @angular-cli

      

The same problem still appears.

+3


source to share


4 answers


The package is called @angular/cli

, therefore npm install -g @angular/cli

.



+3


source


@angular-cli

- previous version. Now you need

npm install -g @angular/cli

      



to work with @angular/cli

version

+1


source


The package you specified is invalid. For a fresh install use npm install -g @angular/cli

. See here for details https://github.com/angular/angular-cli#installation


Also if you are updating this, https://github.com/angular/angular-cli#updating-angular-cli


If you are updating from beta / version follow this https://github.com/angular/angular-cli/wiki/stories-1.0-update


angular-cli

uses angular.cli.json. whereas @angular/cli

using .angular.cli.json

0


source


i is also facing the same problem so i tried this method given below.

Clean uninstall angular-cli, for example npm uninstall -g angular-clone Clone this angular-cli repo, Go to angular-cli repo folder and run npm link, Go to project folder Run npm link angular-cli Now to run the ng command I am using. / node_modules / angular-cli / bin / ng from my project folder

0


source







All Articles