Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node REPL does not work in a cygwin shell #10238

Closed
Akpotohwo opened this issue Dec 12, 2016 · 16 comments
Closed

Node REPL does not work in a cygwin shell #10238

Akpotohwo opened this issue Dec 12, 2016 · 16 comments
Labels
question Issues that look for answers. repl Issues and PRs related to the REPL subsystem. windows Issues and PRs related to the Windows platform.

Comments

@Akpotohwo
Copy link

Akpotohwo commented Dec 12, 2016

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:

cygwin

@mscdex mscdex added question Issues that look for answers. windows Issues and PRs related to the Windows platform. labels Dec 12, 2016
@sam-github
Copy link
Contributor

You have seen #384?

does not work

You could provide some more info, what you did, what happened, what you expected.

/cc @nodejs/platform-windows

@Fishrock123
Copy link
Contributor

@Akpotohwo Could you try node --interactive? It might see it as a pipe rather than a terminal.

@Fishrock123 Fishrock123 added the repl Issues and PRs related to the REPL subsystem. label Dec 12, 2016
@gibfahn
Copy link
Member

gibfahn commented Dec 12, 2016

@sam-github I think this is an error with running the node repl in Cygwin, which I think we do try to support

@Akpotohwo
Copy link
Author

@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:
works

@joaocgreis
Copy link
Member

@Akpotohwo This is because of the way Cygwin emulates the Windows console. Can you try to run winpty node? (Ref #3006 , #5620 )

@TimothyGu
Copy link
Member

@Akpotohwo have you tried @joaocgreis's suggestion? Or can this be closed?

@Akpotohwo
Copy link
Author

@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

@billwolckenlmco
Copy link

@Akpotohwo - did you build winpty and did that make a difference?

@Trott
Copy link
Member

Trott commented Aug 10, 2017

I'm confused if the winpty would be considered a solution or merely a workaround. Which is it?

@gibfahn
Copy link
Member

gibfahn commented Aug 10, 2017

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.

@tniessen
Copy link
Member

As far as I know it is necessary to use winpty as long as we are compiling with MSVS.

@Trott
Copy link
Member

Trott commented Aug 10, 2017

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.

@Trott Trott closed this as completed Aug 10, 2017
@yolob21
Copy link

yolob21 commented Mar 1, 2018

has any fix been released, repl breaks on syntax error in cygwin

@Trott
Copy link
Member

Trott commented Mar 1, 2018

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.

@tniessen
Copy link
Member

tniessen commented Mar 5, 2018

@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).

@7fe
Copy link

7fe commented Aug 16, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers. repl Issues and PRs related to the REPL subsystem. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests