I solved this problem in accordance with the figure:
run in cmd
npm install -g @angular/cli
and then
( open in Windows 10) Control PanelAll Control Panel ItemsSystem
or accordance with the figure
step 1:
step 2 :
step3:
step4:
step5: add missing ng path
Finally, restart all opened command prompts and try again.
For me it works with:
npm run ng