0
votes

I'm setting up angular using CMD. After setting up the installation of Angular using the command "npm install -g @angular/cli" I'm trying to check Angular CLI installed with the command "ng –v", and getting the next input "'np' is not recognized as an internal or external command, operable program or batch file." How can I fix it?

2

2 Answers

0
votes

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 }

You will need to log out then log back in for the change to your PATH variable to take effect.

then run npm start in your project directory.

Second way

Just add %AppData%\npm; to the user variable(since %AppData% dir is depending on user) PATH to fix it.

Source: https://github.com/angular/angular-cli/issues/1183

0
votes

you can simply use this commond:

ng v