angular CLI commands are not working in vs code git bash whereas it’s working in Powershell.
the error is as follows:-
C:UsersamitkAppDataRoamingnpm/node_modules/node/bin/node: line 1: This: command not found
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
Please check the value of the path variable in your environment variable. looks like it can’t find the node command from the path in your git bash environment. Sometime in your windows, the node was pointed to the windows node folder.
In the Powershell please run the command below to identify which node location it’s using
where node
In your git bash check whether the path contains the directory which contains node command.
I know it’s little bit late, but maybe it’ll help some other folks.
You have to set
alias ng
in git bash, after that it will work.First localize
ng.cmd
file inC:/Users/Username/AppData/Roaming/npm/ng.cmd
Go to your git bash and type in:
After that it will recognize your command.
To set
alias ng
permanently in git bash, you have to edit thealiases.sh
file inC:/Program Files/Git/etc/profile.d/aliases.sh
.Just add the alias syntax to the other ones.
Hope this helps!