angularangular-schematics

Install angular schematics on mac: command not found


I'm trying to install the schematics-cli for angular on a mac (sierra 10.12.6) but I get command not found errors when I try to run it in the command line.

I install it globally with:

npm install -g @angular-devkit/schematics-cli

and can see it listed as a global install as npm list --depth=0 -g gives /usr/local/Cellar/node/10.1.0/lib ├── @angular-devkit/schematics-cli@0.8.1 ├── @angular/cli@6.1.5 ├── @schematics/schematics@0.7.5 ├── npm@6.3.0 ├── rxjs@6.3.1 ├── rxjs-tslint@0.1.5 ├── UNMET PEER DEPENDENCY tslint@^5.0.0 └── UNMET PEER DEPENDENCY typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev However, if I try to run a command e.g. schematics --help I get -bash: schematics: command not found

Any suggestions for what's going wrong?


Solution

  • This is for Mac:

    Open

    vim ~/.bash_profile
    

    add this to the file:

    export PATH="/usr/local/lib/node_modules/@angular-devkit:$PATH"