I'm trying to run the node
command in my git bash terminal. When I run the node
command, nothing happens when I press enter. The $
goes away and it just leaves a blinking cursor on the next line without the >
.
My-PC MINGW32 /
$ node -v
v4.5.0
My-PC MINGW32 /
$ where node
C:\Program Files\nodejs\node.exe
My-PC MINGW32 /
$ node
_
Could someone tell me what the issue could be?
Thanks!!
If you're not getting a new line with a >
after entering "node" - this is probably because newer versions of Git Bash don't run in the TTY mode they used to. Discussion here. You can verify by entering:
node -p -e "Boolean(process.stdout.isTTY)"
If that returns false - then the Node REPL (and some other console tools) won't work correctly.
There are a couple workarounds:
winpty node
Or you can add an alias in your .bash_profile:
alias node="winpty node"
# and for npm CLI/scripts:
alias npm="winpty npm.cmd"
Create a new shortcut to Git Bash with the following Target:
"C:\Program Files\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i
and use that instead of the default Git Bash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With