Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Bash does not work for npm, node, ng commands but all these commands works in powershell windows 10

Few months back all worked well but now some update or something broke my setup for Angular development setup. I got all latest node, npm, ts, ng and VS code. Used to work well. But today, after few months i updated all and found that these commands for ng doesnot work in Git BASH MING64 command window. All works well and in windows cmd and powershell. I noticed strange forward and backward slashes in path under git Bash window though. My environment path for System and current user all set.

RonPC@RON-DESKTOP MINGW64 ~/Documents/VScode-Projects/AngularProjects/angular2020/jan2020 (master)
$ ng --version
C:\Users\RonPC\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

RonPC@RON-DESKTOP MINGW64 ~/Documents/VScode-Projects/AngularProjects/angular2020/jan2020 (master)
$ npm ng --version
C:\Users\RonPC\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

RonPC@RON-DESKTOP MINGW64 ~/Documents/VScode-Projects/AngularProjects/angular2020/jan2020 (master)
$ npx ng --version
C:\Users\RonPC\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

RonPC@RON-DESKTOP MINGW64 ~/Documents/VScode-Projects/AngularProjects/angular2020/jan2020 (master)
$ node v
C:\Users\RonPC\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

RonPC@RON-DESKTOP MINGW64 ~/Documents/VScode-Projects/AngularProjects/angular2020/jan2020 (master)
$ node --version
C:\Users\RonPC\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

RonPC@RON-DESKTOP MINGW64 ~/Documents/VScode-Projects/AngularProjects/angular2020/jan2020 (master)

anyone got tip to get it fixed. I tried installing git BASH again but no help. regards

Screenshot of path for system environment vars

Screenshot showing my installed components of node, npm and ng

like image 459
RON_au Avatar asked Sep 12 '25 10:09

RON_au


1 Answers

Solution:

After going through numerous solution listed on different forums, re-installing Nodejs/Git Bash cmd, tinkering PATHS.. no luck.

Very simple solution:

But i uninstalled "node" from Add Remove Programme --> deleted folder"npm" & "npm-cache" from location --> C:\Users\RonPC\AppData\Roaming

Reinstalled Node.js(npm installed with it) and it worked like charm.

Hopefully it saves anyone having trouble for this reason.

Regards

like image 129
RON_au Avatar answered Sep 14 '25 02:09

RON_au