1

I have verified both node and npm are installed: console image

They are also working in other shells, including VSCode using Powershell. However when running npm install in GitBash, I'm getting this error:

'node' is not recognized as an internal or external command,
operable program or batch file.

I would expect that GitBash since it knows of the install of Node, could also run npm install without an error. Any ideas?

1 Answer 1

0

You will have to modify your path in Git Bash. Type this into Git Bash:

echo $PATH

It will print a long list. If your node.js installation directory shows in there (/c/Program Files/nodejs) it should work. If it is not, here is how to fix the path: Go to Control Panel (Not the Settings app)->System and Security->System->Advanced System Settings-> Under the Advanced Tab, go to Environmemt Variables Under System Variables find the PATH variable. Select that and click edit, and add a new entry, which will be the path to your node js installation directory (Usually C:\Program Files\nodejs).

This will change your path variables. You have to restart git bash, but then it should work. This tells bash when you run those commands to point to that directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .