-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Strange behavior for CLI options -e and -p on Windows #15522
Comments
mscdex
added
cli
Issues and PRs related to the Node.js command line interface.
doc
Issues and PRs related to the documentations.
windows
Issues and PRs related to the Windows platform.
labels
Sep 21, 2017
Windows shell traditionally uses double quote as the quote char. The documentation already suggests using If you think that this needs more clarification, feel free to open a PR |
Thank you @bzoz for comment, so I will prepare PR for this. |
lukaszewczak
added a commit
to lukaszewczak/node
that referenced
this issue
Sep 23, 2017
lukaszewczak
added a commit
to lukaszewczak/node
that referenced
this issue
Sep 23, 2017
4 tasks
jasnell
pushed a commit
that referenced
this issue
Sep 26, 2017
PR-URL: #15568 Fixes: #15522 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this issue
Sep 29, 2017
PR-URL: #15568 Fixes: #15522 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax
pushed a commit
to addaleax/ayo
that referenced
this issue
Sep 30, 2017
PR-URL: nodejs/node#15568 Fixes: nodejs/node#15522 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this issue
Oct 17, 2017
PR-URL: #15568 Fixes: #15522 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this issue
Oct 25, 2017
PR-URL: #15568 Fixes: #15522 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
As I went through the CLI tutorial, I came across a strange situation while executing simple command.
The problem was with this two commands, with options
-p
and-e
$ node -e 'console.log(3 + 2)'
and
$ node -p '3 + 2'
On Linux those two commands execute correctly.
But on Windows I receive this:
node -e 'console.log(3 + 4)'
After I remove spaces, I got no error, but without a result:
So I change the
-e
option to-p
, I receive this:Node prints my script as a string without evaluating it.
node -p '3 + 2'
After removing spaces, I receive string like in the previous example:
So I went to the CLI docs, I I saw this description:
There is one difference in my examples according to docs. It seams I need to use double quote
"
instead of single quote'
.So let's test it.
Ok, this works!
And another example works too.
So it looks like for Windows I need to use double quote
"
but on Linux it doesn't matter what I used, because every version works on Linux.If this is not a bug, but expected result, I think there should be at least some info in the docs that on Windows you should use only double quote
"
. Because without this info, going thru tutorials you can get really frustrated when you try to execute this simple command and it not work.The text was updated successfully, but these errors were encountered: