vercel / next.js

The React Framework
https://nextjs.org
MIT License
126.96k stars 26.98k forks source link

Docs: following developing.md results in 'turbo: command not found' #52943

Closed domdomegg closed 3 months ago

domdomegg commented 1 year ago

What is the improvement or update you wish to see?

Following the guide https://github.com/vercel/next.js/blob/canary/contributing/core/developing.md results in getting stuck at the pnpm dev step with the error:

next.js % pnpm dev

> nextjs-project@0.0.0 dev /Users/user/Documents/next.js
> turbo run dev --parallel

sh: turbo: command not found
 ELIFECYCLE  Command failed.

Information about my machine:

Node: v20.4.0 (via brew) npm: 9.7.2 corepack: 0.19.0 (via npm) pnpm: 8.6.9 (via corepack) Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:46 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6020 Commit sha: 8e3cd83dc89207dfbdbc25c63efc7e389db06994

Is there any context that might help us understand?

Hit this when trying to contribute #52939

Does the docs page already exist? Please link to it.

https://github.com/vercel/next.js/blob/canary/contributing/core/developing.md

balazsorban44 commented 1 year ago

I cannot reproduce this, have you maybe forgotten to run pnpm install (step 5)?

turbo is correctly added as a dependency and should have been installed:

https://github.com/vercel/next.js/blob/2b497413087c56dedb3e04f77ea0deebb5d12d0b/package.json#L224

domdomegg commented 1 year ago

Thanks. I did run pnpm install, but I've tried again and get the same result:

Logs ``` user@MacBook-Pro next.js % pnpm install Scope: all 21 workspace projects Lockfile is up to date, resolution step is skipped Packages: +3090 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  WARN  GET https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/asciichart/-/asciichart-1.5.25.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/commander/-/commander-2.20.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/downsample-lttb/-/downsample-lttb-0.0.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/listr2/-/listr2-5.0.5.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/asciichart/-/asciichart-1.5.25.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/commander/-/commander-2.20.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/downsample-lttb/-/downsample-lttb-0.0.1.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/listr2/-/listr2-5.0.5.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.  WARN  GET https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  ERR_INVALID_THIS  Value of "this" must be of type URLSearchParams pnpm [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams at new NodeError (node:internal/errors:405:5) at Proxy.getAll (node:internal/url:527:13) at Proxy. (/Users/user/.cache/node/corepack/pnpm/7.24.3/dist/pnpm.cjs:59377:55) at /Users/user/.cache/node/corepack/pnpm/7.24.3/dist/pnpm.cjs:59439:31 at Array.reduce () at Proxy.raw (/Users/user/.cache/node/corepack/pnpm/7.24.3/dist/pnpm.cjs:59438:33) at new Headers (/Users/user/.cache/node/corepack/pnpm/7.24.3/dist/pnpm.cjs:59323:28) at getNodeRequestOptions (/Users/user/.cache/node/corepack/pnpm/7.24.3/dist/pnpm.cjs:59672:23) at /Users/user/.cache/node/corepack/pnpm/7.24.3/dist/pnpm.cjs:59729:25 at new Promise ()  WARN  GET https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.  WARN  GET https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left. Progress: resolved 3090, reused 0, downloaded 0, added 0 user@MacBook-Pro next.js % pnpm dev > nextjs-project@0.0.0 dev /Users/user/Documents/next.js > turbo run dev --parallel sh: turbo: command not found  ELIFECYCLE  Command failed. ```
domdomegg commented 1 year ago

After looking around some more, I think this issue is stemming from using Node v20 with an older version of PNPM

Related PNPM bug: https://github.com/pnpm/pnpm/issues/6424

I think to fix this we could either:

domdomegg commented 1 year ago

It looks like someone tried to fix this in https://github.com/vercel/next.js/pull/51406, but that was reverted by https://github.com/vercel/next.js/pull/51539

@ijjk are you able to expand on the lockfile issues you mentioned there? Unfortunately I don't have lots of experience using pnpm so would appreciate any advice on what next steps might look like :)

domdomegg commented 1 year ago

I've opened https://github.com/vercel/next.js/pull/52955 as a partial solution that mitigates this somewhat by providing an informative error message to users when they're using Node 20. But I think this ticket should stay open until we fix Node 20 contributor support in general (e.g. figure out how to upgrade PNPM, like #51406, but without the issues mentioned in #51539).

jrafael29 commented 3 months ago

I had same problem. I tried install this package sudo apt-get install build-essential on my machine, then pnpm install have done without error. Try it.

domdomegg commented 3 months ago

I'm going to close this issue given I think the bug I originally reported was fixed by https://github.com/vercel/next.js/pull/50923

However @jrafael29 if you're having issues it might be worth creating a new issue and providing more detailed logs as to what errors you encounter.

github-actions[bot] commented 2 months ago

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.