Running windows 7 Professional 32bit.
I tried running npm install -g angular-cli both under normal or admin.
I also tried adding it to the Enviorment Variables under PATH: (C:\Users\Administrator\AppData\Roaming\npmnode_modules\angular-cli\bin\ng) , with no success also.
What am i doing wrong?
The only thing that you are doing wrong is using windows :smile:
Just add %AppData%\npm; to the user variable(since %AppData% dir is depending on user) PATH to fix it.
You will need to log out then log back in for the change to your PATH variable to take effect.
@muscaiu are you still having this problem? @RicardoVaranda's solution seems the right one. Your system wasn't configured with the right PATH for some reason.
I have the same problem, the path to npm added to the PATH variable, so I think the problem is that the system can not run "ng" file.
I fixed the problem.
See here: http://stackoverflow.com/questions/37991556/ng-is-not-recognized-as-an-internal-or-external-command
Thanks, fix it.
In case you are editing environment variables make sure you edit for account you are running under.
After spend about one hour to fix "ng is not recognized" in my Windows console I opened a new prompt as "administrator", unninstalled the "angular-cli", cleaned npm cache via "npm cache clean" and installed it again and finally worked o/
I guess the main issue is because you need to do all this installation process as root ("as administrator" in Windows).
Use NodeJS command prompt rather Windows Command, NodeJs command prompt will recognize ng.
Just open your command prompt (run as administrator). Ensure node --v is 6.9.0 or higher and npm --v is 3.0.0 r higher.
After that run the following command:
npm install -g @angular/cli
Once angular is installed. you can see an entry of angular cli in the path
C:\Users\Dell\AppData\Roaming\npmnode_modules\@angular
Then try ng help. It will work.
i had same "ng is not recognized as internal and external command,operable program or batch file "
node version:6.10
just upgrade new version like node 6.11 or latest
while re-installing angular put it in new path like c://erp/ee
At last find the solution for ng command is not working issue ,Find the solution below http://itechiesol.blogspot.com/2017/07/angular-cli-ng-command-is-not-working.html
@Shrutikarekal123 it works now perfectly, thank you very much :)
@gautamjgithub i added %APPDATA%\npmnode_modules@angular to my PATH and it worked! Thanks!
if you try any of the above method and not working make make sure you are using a git bash. This works for one window system i work on. some command do not work on a CMD either as an admin or not. you can download a git bash for window system here https://git-scm.com/downloads
I had the same problem today and have gone through the following path -
(_%USERPROFILE%\AppData\Roaming\npm_) and came to know that there is some junk data and when I cleared everything under npm directory. Now when I ran (_npm install_ command again). Now everything works fine.
Just as an update for anyone running into the same. ng
was working fine for me. Yesterday I installed Miktex on my computer and after that ng stopped working. I think it messed up with my Path variable somehow. Adding the npm path again as @RicardoVaranda said works.
Use NodeJS command prompt. I fix my problem.
Just execut:
npm run ng <command name>
Add the ng command path from the folder .bin under the node_modules to PATH variable in the system env settings
e.g: add C:\testProject\node_modules\.bin\
to PATH
run : npm install -g angular-cli
set the path variable =C:\Users\ACER\AppData\Roaming\npmnode_modules\angular-cli\bin
You will need to log out then log back in for the change to your PATH variable to take effect.
You don't have to log out and back in, all you need to do is restart explorer.exe OR open up your CMD and run refreshenv
I had the same issue "'ng' is not recognized as an internal or external command,
operable program or batch file." when I was trying to run ng serve --host 0.0.0.0 form my command prompt.
But as I run it via node.js command prompt, my issue resolve and I was able to run
ng serve --host 0.0.0.0.
And
It also ran when I prefix it with npm run ng serve as mentioned above, but then I was facing issue for --host 0.0.0.0 as it was throwing error.
Can anyone tell me the reason why? What is happening which I am unable to get.?
please don't confuse yourself... just do one thing
ADD -> " C:\Users\DELL\AppData\Roaming\npm " to PATH in system variable
All set !
Please try to use Node.js command prompt in your windows. It will work.
npm start also works great
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
The only thing that you are doing wrong is using windows :smile:
Just add %AppData%\npm; to the user variable(since %AppData% dir is depending on user) PATH to fix it.
You will need to log out then log back in for the change to your PATH variable to take effect.