NodeJS version: v10.0.0
npm version: 5.6.0
After I did 'npm install -g @angular/cli' it was successfully installed
But when I try to run the 'ng' command: 'ng' is not recognized as internal or external command
NodeJS version: v10.0.0
npm version: 5.6.0
After I did 'npm install -g @angular/cli' it was successfully installed
But when I try to run the 'ng' command: 'ng' is not recognized as internal or external command
In some cases works only with this command, try it.
npm run ng
Please check if you have ng command prompt file in your npm system environment path:
For example, if your system npm path user environment variable is - C:\Users\priyanka\AppData\Roaming\npm, make sure the ng command prompt file is present in the specified path.
If the path for npm is not present, kindly add the above specified path into the path variable.
Once done kindly restart app and re run the above ng command.
Hope this helps!
On Windows: Check if the npm path "C:\Users\user\AppData\Roaming\npm" is on the Path variable on Environment Variables of windows.
Check if the file ng.cmd is on this folder C:\Users\user\AppData\Roaming\npm.
If not, run the command npm install -g @angular/cli and test again.
Use following command in cmd to create folder locally "npx new [foldername]" in the required directory
Try to repair your nodejs installation by reinstalling it and choose the repair option.
What you can do is : (1) Set the Path variable under System Variable to "C:\Users\user\AppData\Roaming\npm"
(2) now try to hit below commands in new CMD : ng -v or ng version
because in my case ng version is giving the output.