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

can not run sample of README.md first one #26

Closed
ZQ-jhon opened this issue May 8, 2021 · 5 comments
Closed

can not run sample of README.md first one #26

ZQ-jhon opened this issue May 8, 2021 · 5 comments

Comments

@ZQ-jhon
Copy link

ZQ-jhon commented May 8, 2021

Expected Behavior

print output to console

Actual Behavior

file:///Users/zq-jhon/.nvm/versions/node/v10.2.0/lib/node_modules/zx/zx.mjs:43
let ok = await scriptFromStdin()
^^^^^

Steps to Reproduce the Problem

  1. npm i zx -g
  2. cd ~/desktop && vim test.mjs
  3. paste the code and :wq save and quit:
#!/usr/bin/env zx

await $`cat package.json | grep name`

let branch = await $`git branch --show-current`
await $`dep deploy --branch=${branch}`

await Promise.all([
  $`sleep 1; echo 1`,
  $`sleep 2; echo 2`,
  $`sleep 3; echo 3`,
])

let name = 'foo bar'
await $`mkdir /tmp/${name}`
  1. zx ./test.mjs

Specifications

  • Version:
  1. node version: v12.21.0
  2. nvm version: v0.37.0
  • Platform: macOS Catalina v10.15.7
@thethreeonee
Copy link

same here

node: 14.2.0

macOS: Big Sur v11.2.3

@Artoria2e5
Copy link

Artoria2e5 commented May 8, 2021

No, look, it literally is not "same here". zx requires node 14+ (#8), so having a node 14 report this problem is totally a different issue.

And I really feel the need to yell about this "actual behavior" report. Put that into a code block and show the name of the error next time, please.

@ZQ-jhon
Copy link
Author

ZQ-jhon commented May 8, 2021

Put that into a code block and show the name of the error next time, please.

Resolved! thanks.

@thethreeonee
Copy link

thethreeonee commented May 8, 2021

No, look, it literally is not "same here". zx requires node 14+ (#8), so having a node 14 report this problem is totally a different issue.

And I really feel the need to yell about this "actual behavior" report. Put that into a code block and show the name of the error next time, please.

There's NO node requirement in README, how can I know it requires node 14+?

And, in my case, the error message is the same as this issue, how can I know it's different issue?

Full error message here:

file:///Users/xxx/.nvm/versions/node/v14.2.0/lib/node_modules/zx/zx.mjs:43
    let ok = await scriptFromStdin()
             ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
    at async link (internal/modules/esm/module_job.js:37:21)

@hehehai
Copy link

hehehai commented May 9, 2021

No, look, it literally is not "same here". zx requires node 14+ (#8), so having a node 14 report this problem is totally a different issue.
And I really feel the need to yell about this "actual behavior" report. Put that into a code block and show the name of the error next time, please.

There's NO node requirement in README, how can I know it requires node 14+?

And, in my case, the error message is the same as this issue, how can I know it's different issue?

Full error message here:

file:///Users/xxx/.nvm/versions/node/v14.2.0/lib/node_modules/zx/zx.mjs:43
    let ok = await scriptFromStdin()
             ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
    at async link (internal/modules/esm/module_job.js:37:21)

nodejs version problem

nodejs/node#33474

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants