1
votes

I am using Node 8.9.3 and npm 5.5.1 and I have installed Angular latest version with this command:

npm install -g @angular/cli@latest

Then, I set the path in the environment variable as

PATH C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\bin

Finally I run

ng --version

which results the following error:

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

Please help me in fixing this error.

1
WHy would you change your path ? I've never had have to do that ... - user4676340
@trichetriche it is a suggestion given by somebody. without doing that also same issue happens. - Sta-Dev
Probably not given by the Angular team though. - user4676340
@trichetriche have followed everything given in angular docs. Having the latest version of node and npm. Still the same. - Sta-Dev
I just checked (to be sure), I have no reference to the CLI in my path. Remove it and see how it goes. - user4676340

1 Answers

1
votes

Just add %AppData%\npm; to the user PATH variable to fix it. (%AppData% maps to the appropriate dir for the user)

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

You can get help from here.