After I ran npm install @angular/cli, I could still not run the ng command. My terminal said that the command was not found. Btw, I use fish. Here’s what I had to do to solve the problem.
npm list -g
The very first line will show you where your global node modules are stored. Which in my case was /Users/user_name/.npm-packages/lib
Navigate to that folder, in my case:
Now cd into each folder and ls until you see the folder @angular.
Type ls and you should see the file ng.
Type pwd and copy the path to the current folder.
Now add ng as alias.
In fish: vi ~/.config/fish/config.fish
In bash: vi ~/.bashrc
Add the line: alias ng=”url_that_you_copied_before/ng”
Restart your terminal. And you should be good to go!