0

C:\Angula2\myapp>ng serve --open 'ng' is not recognized as an internal or external command, operable program or batch file.

and currently i am having node also in my system

C:\Angula2\myapp>node -v v8.10.0

And How to run Angular4 with out having Admin permissions.

Sibiraj
  • 4,486
  • 7
  • 33
  • 57
dssprakash
  • 3
  • 1
  • 1
  • 3
  • Does this answer your question? [ng is not recognized as an internal or external command](https://stackoverflow.com/questions/37991556/ng-is-not-recognized-as-an-internal-or-external-command) – Vadzim May 25 '21 at 12:29

1 Answers1

1

you have to install angular-cli globally to use ng

npm i -g @angular/cli

to use angular-cli without global installation.

Add ng serve --open to the scripts section in your package.json.

scripts:{
    "start": ng serve --open
}

then run npm start in your project directory.

Sibiraj
  • 4,486
  • 7
  • 33
  • 57
  • it isn't mandatory, when you use npm, npm will look for binaries inside `node_modules/bin`, hence npm start will work when angular/cli isn't globally installed. ng will work even in windows when installed globally, as npm creates symlinks for the the npm modules – Sibiraj May 18 '18 at 12:33