gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.28k stars 10.31k forks source link

Error when using create-gatsy: TypeError: qi.cursorTo is not a function #37921

Closed 0618 closed 1 year ago

0618 commented 1 year ago

Preliminary Checks

Description

When running npx create-gatsby@latest -y my-gatsby on Github Workflow, got following error

TypeError: Xi.cursorTo is not a function
    at Timeout._onTimeout (/home/runner/.npm/_npx/fe8a8be88628f971/node_modules/create-gatsby/lib/index.js:5:854)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

Same as https://github.com/gatsbyjs/gatsby/issues/35426

Reproduction Link

https://github.com/0618/amplify-ui/actions/runs/4634161974/jobs/8200091938

Steps to Reproduce

  1. In Github workflow, set Node version to be 18
  2. run npx create-gatsby@latest -y my-gatsby

Expected Result

Shouldn't crash

Actual Result

See error

TypeError: Xi.cursorTo is not a function
    at Timeout._onTimeout (/home/runner/.npm/_npx/fe8a8be88628f971/node_modules/create-gatsby/lib/index.js:5:854)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

Environment

Operating System
  Ubuntu
  22.04.2
  LTS
Runner Image
  Image: ubuntu-22.04
  Version: 20230402.1
  Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230402.1/images/linux/Ubuntu2204-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230402.1
Node.js v18.15.0

Config Flags

No response

LekoArts commented 1 year ago

Hi, thanks for the issue!

As explained in the old issue, please try https://github.com/gatsbyjs/gatsby/issues/35426#issuecomment-1099798549. Our code uses https://github.com/ascorbic/tiny-spin to create a spinner icon. It uses process.stderr.cursorTo.

https://nodejs.org/docs/latest-v18.x/api/readline.html#rlcursortox-y

Reading https://github.com/nodejs/node-v0.x-archive/issues/6933 it seems that this is only available in TTY streams though. And according to https://github.com/actions/runner/issues/241 GitHub actions has problems with that (and only workarounds). So I'd also try these.

Please make sure that you run create-gatsby in the right environment and let us know if you need any more guidance. Thanks!

0618 commented 1 year ago

@LekoArts https://github.com/gatsbyjs/gatsby/issues/35426#issuecomment-1099798549 doesn't work as you can see in the original issue. --no-color is for gatsby build, but the issue is from create-gatsby. Also, adding GATSBY_LOGGER=yurnalist before create-gatsby doesn't work either.

The issue is still not resolved. Please do not close it.

LekoArts commented 1 year ago

And according to https://github.com/actions/runner/issues/241 GitHub actions has problems with that (and only workarounds). So I'd also try these.

You should try these then. We're just using Node.js functions that should always be available.

Anyways, you can also just remove create-gatsby and do a git clone of https://github.com/gatsbyjs/gatsby-starter-minimal. Because that's all what npx create-gatsby@latest -y is doing.