0

ng command is not getting recognized when used. I have already tried installing angular at global level and did the settings as per

Angular's - 'ng' is not recognized as an internal or external command, operable program or batch file

angularjs/cli- Ng is command is not working as globle

but no luck.

Can you please let me know what specific settings are required to achieve this.

Error: ng' is not recognized as an internal or external command, operable program or batch file.

Adding project structure as needed

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
Vivek
  • 725
  • 3
  • 8
  • 15

4 Answers4

1

You need to make sure you have nodeJS installed. Best of all, the latest version. You can see if it's working by typing node -v. Your node version should be greater than 6.x.x. Then install angular cli globaly using npm install -g @angular/cli. Then create your project using ng new yourprojectname or try to start your existing cli project by using ng serve in the project root.

billyjov
  • 2,778
  • 19
  • 35
0

-->First check angualr cli installed or not by using, ng -v, if not install angualr cli by using

npm install -g @angular/cli .then

  1. Go to the folder “C:\Users\AppData\Roaming\npm” and copy two files i. ng File ii. ng command script

  2. Now navigate to your angular application folder let say (my angular application folder is D:\AngularApplication(where you can see the angular.json file)

  3. Paste above two files

  4. Now windows command prompt also supports ng commands.

Everything works fine now

0

If you are using windows at first try install(or reinstall) npm or node. Then hit the following command.

**set PATH=%PATH%;C:\Users\[YOUR_WINDOWS_USER_NAME\AppData\Roaming\npm;**
Md Wahid
  • 450
  • 5
  • 12
0

Install Node.js and angular as an administrator or give your user an administrator role.