0

angular CLI commands are not working in vs code git bash whereas it's working in Powershell. the error is as follows:- C:\Users\amitk\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

2 Answers 2

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!

Sign up to request clarification or add additional context in comments.

Comments

0

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.

1 Comment

To locate a command in PowerShell, use Get-Command. Alternatively, use where.exe, but you must invoke it with .exe, because where is a built-in PowerShell alias for the unrelated Where-Object cmdlet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.