npm install -g @angular/cli
ng --version results in a message "bash /usr/bin/ng: No such file or directory in Angular",
it is possible that you install Angular (running the
npm install -g @angular/cli command) with root.
Try to remove angular-cli and then reinstall
sudo npm remove -g @angular/cli
sudo npm install -g @angular/cli
ng command still cannot be found, try setting alias.
Be sure to use the correct path where your
ng is installed.
(the paths where the
ng is installed can be found when running
sudo npm install -g @angular/cli command).
(Note: the sample image is from a Mac user.)
Suppose your node.js version is v14.6.0. To set an alias, use the following setting:
Note: while we are working on Angular 10, most of what we do work the same with Angular 8 and 9.
Alternatively, PhpStorm also works well with Angular and TypeScript.
ng newcommand to create a folder with the app name
ng new angular-example
Yto the question about generating a routing module
You should see a screen similar to the following