The error may occur if the NodeJs
is installed incorrectly or not installed at all.
The proper way to fix that is to install/reinstall it the right way (check their official website for that), but if you're searching for a quick solution, you can try to install Angular CLI globally:
npm install -g @angular/cli
If it doesn't work and you are in a hurry, use sudo
:
sudo npm install -g @angular/cli
Don't forget to reopen your terminal window.