redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.36k stars 1k forks source link

[Bug?]: corepack enable does nothing on fresh clone (yarn stays on v1.x) #10899

Open JoshuaKGoldberg opened 5 months ago

JoshuaKGoldberg commented 5 months ago

What's not working?

I tried setting up a new repo locally and on github.dev on a pairing session with @Tobbe today. I went through the instructions in CONTRIBUTING.md:

https://github.com/redwoodjs/redwood/blob/a685bd424ae3beb5f94173fd4815ebe6b68fe190/CONTRIBUTING.md?plain=1#L58-L61

...but Yarn is still using my local 1.x version:

joshgoldberg ~/repos/redwood $ corepack enable
joshgoldberg ~/repos/redwood $ yarn install
yarn install v1.22.19
[1/4] 🔍  Resolving packages...
error Couldn't find package "//verdaccio.tobbe.dev/" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
joshgoldberg ~/repos/redwood $ 

How do we reproduce the bug?

  1. Press . on https://github.com/redwoodjs/redwood
  2. Set up a new codespace
  3. In the terminal, run corepack enable and yarn install

What's your environment? (If it applies)

I copied this from another issue I filed recently:

System:
    OS: macOS 13.2
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.11.0 - /var/folders/sr/j__6_9gn0dv557z0xf3p7y8h0000gn/T/yarn--1719857847260-0.8362240404148904/node
    Yarn: 1.22.19 - /var/folders/sr/j__6_9gn0dv557z0xf3p7y8h0000gn/T/yarn--1719857847260-0.8362240404148904/yarn
  Databases:
    SQLite: 3.39.5 - /usr/bin/sqlite3
  Browsers:
    Chrome: 124.0.6367.93
    Safari: 16.3
  npmPackages:
    @redwoodjs/core: 7.7.2 => 7.7.2 
    @redwoodjs/project-config: 7.7.2 => 7.7.2 
  redwood.toml:
    [web]
      title = "Redwood App"
      port = 8910
      apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
      includeEnvironmentVariables = [
        # Add any ENV vars that should be available to the web side to this array
        # See https://redwoodjs.com/docs/environment-variables#web
      ]
    [api]
      port = 8911
    [browser]
      open = true
    [notifications]
      versionUpdates = ["latest"]

...because trying to run the command in my local repo gives:

 $ yarn rw info
yarn run v1.22.19
error Command "rw" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Are you interested in working on this?

I've hit confusing issues with Yarn versioning before (https://github.com/yarnpkg/berry/issues/4426) and have no interest in working on this myself. 😄

Tobbe commented 5 months ago

I filed an issue with corepack about this https://github.com/nodejs/corepack/issues/507 As I write in the issue description, a workaround is to use corepack yarn instead of just yarn. And corepack yarn build, corepack yarn rebuild-test-project-fixture etc.

I'll give the corepack people some time to to reply to my issue before I decide what the best way forward here is

simoncrypta commented 3 months ago

I had the same issue, but it finally works after using a new terminal session.