Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sh.exe": node: command not found

I'm trying to run a javascript file in Gitbash but getting this error.

$ node chrome-devtools-autosave-server/index.js
sh.exe": node: command not found

Screenshot

enter image description here

How to solve this?

My OS is Windows 7 (64 Bit)

like image 786
Jitendra Vyas Avatar asked Dec 17 '11 07:12

Jitendra Vyas


2 Answers

Node is not 'visible' in MINGW32 by default, only in the Windows Command Terminal. Same goes for npm.

How to add it (if you have Node installed), from the official MINGW FAQ:

MSYS uses a Bourne-like shell, hence you can change the PATH using the export command.
The easiest way to add something to the end of the PATH is with the command:

export PATH=$PATH:directory-to-add

So you have to add the directory where Node is installed (probably something like C:\Program Files\nodejs).

like image 73
alessioalex Avatar answered Oct 11 '22 02:10

alessioalex


You are missing double quotes for path varible

export PATH=$PATH:"C:\Program Files\nodejs"

like image 40
Pravin Kottawar Avatar answered Oct 11 '22 03:10

Pravin Kottawar