Versions: 6.2.2, 6.9.1, 4.4.7, 0.12.17 & 0.10.47
I tried running the Node REPL with those versions in a cygwin shell and it did not work.
It's not an installation problem, the Node REPL does not start in a cygwin shell.
If you run node in the shell, it hangs, and you never get to the > prompt. You have to manually stop the process.
I have attached a screenshot below:
You have seen https://github.com/nodejs/node/issues/384?
does not work
You could provide some more info, what you did, what happened, what you expected.
/cc @nodejs/platform-windows
@Akpotohwo Could you try node --interactive? It might see it as a pipe rather than a terminal.
@sam-github I think this is an error with running the node repl in Cygwin, which I think we do try to support
@Fishrock123 The fix you suggested, i.e running "node --interactive" works as shown below. It just seems to behave weirdly when it comes across a syntax error. All is shown below:
@Akpotohwo This is because of the way Cygwin emulates the Windows console. Can you try to run winpty node? (Ref https://github.com/nodejs/node/issues/3006 , https://github.com/nodejs/node/issues/5620 )
@Akpotohwo have you tried @joaocgreis's suggestion? Or can this be closed?
@TimothyGu @joaocgreis I tried it, but winpty couldn't be found. I'm trying to build winpty now and see if that makes a difference
@Akpotohwo - did you build winpty and did that make a difference?
I'm confused if the winpty would be considered a solution or merely a workaround. Which is it?
I'm confused if the winpty would be considered a solution or merely a workaround. Which is it?
I _think_ it's a necessary evil on cygwin, but @nodejs/platform-windows would know more than me.
As far as I know it is necessary to use winpty as long as we are compiling with MSVS.
OK, in that case, I'm going to close this. If anyone feels that's incorrect, feel free to re-open (if GitHub lets you) or leave a comment.
has any fix been released, repl breaks on syntax error in cygwin
has any fix been released, repl breaks on syntax error in cygwin
As I understand it, there's no fix to release. The solution is to run winpty node if you need to use the REPL. Correction/clarification from @nodejs/platform-windows welcome.
@yolob21 Are you experiencing the same problem as described above? If so, then @Trott is right, there currently is no solution apart from using winpty (which should solve most problems).
Another possible solution is to run Cygwin inside of command prompt. This works for me although is a rather weird solution that requires no additional software.
Most helpful comment
@Akpotohwo Could you try
node --interactive? It might see it as a pipe rather than a terminal.