None of the above solutions alone worked for me. On Windows 7 this worked:
Install Rapid Environment Editor and remove any entries for node, npm, angular-cli or @angular/cli
Uninstall node.js and reinstall.
Run Rapid Environment Editor again and make sure node.js and npm are in your System or User path.
Uninstall any existing ng versions with:
npm uninstall -g angular-cli
npm uninstall -g @angular/cli
npm cache clean
Delete the C:\Users\YOU\AppData\Roaming\npm\node_modules\@angular
folder.
Reboot, then, finally, run:
npm install -g @angular/cli
Then hold your breath and run ng -v. If you're lucky, you'll get some love. Hold your breath henceforward every time you run the ng command, because 'command not found' has magically reappeared for me several times after ng was running fine and I thought the problem was solved.
npm uninstall -g angular-cli
– ranakrunal9npm uninstall -g @angular/cli
(stackoverflow.com/questions/43070441/…) – Jeremy Moritz