skip to Main Content

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

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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 in C:/Users/Username/AppData/Roaming/npm/ng.cmd
    Go to your git bash and type in:

    alias ng='C:/Users/Username/AppData/Roaming/npm/ng.cmd'
    

    After that it will recognize your command.

    To set alias ng permanently in git bash, you have to edit the aliases.sh file in C:/Program Files/Git/etc/profile.d/aliases.sh.

    Just add the alias syntax to the other ones.

    Hope this helps!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search