I am writing this post for ‘ng’ is not recognized as an internal or external command as I haven’t found any proper solution online, especially with stackoverflow.com and github.com/angular/angular-cli/.
I have identified the issue that, It was a conflict of ionic + angular 6 and angular/cli 7 with Windows 10.
An alternative solution, I have tried with ‘Yarn‘, but it was also not able to solve that issue, somehow and somewhere it was accessing path from the user administrator, where I haven’t install nodejs/yarn/angular. I had install separately and globally install on localhost.
Working Solutions implemented.
npm uninstall -g @angular/cli npm uninstall -g ionic cordova npm uninstall -g yarn npm uninstall -g npm
Use Administrator Command prompt or PowerShell
uninstall all tools/packages of Angular
uninstall nodejs from setting=>app=>nodejs Restart the system
I have already installed the scoop.
Disable Ransomware Protection
scoop install yarn scoop install nodejs yarn global add @angular/cli
- npm uninstall -g @angular/cli
- npm uninstall -g ionic cordova
- npm uninstall -g yarn
- npm uninstall -g npm
- uninstall nodejs from setting=>app=>nodejs
- Restart the system.
- I have already installed the scoop.
- disable Ransomware Protection
- scoop install yarn
- scoop install nodejs
- yarn global add @angular/cli
after that ng –version working fine in any directory.
Feel free to contact me, If you have any relevant issue need my assistance. Happy to Help You =:)