expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
824 stars 84 forks source link

[stderr] ERR! notarget No matching version found for yarn@3.2.2. #1629

Closed izakfilmalter closed 1 year ago

izakfilmalter commented 1 year ago

Build/Submit details page URL

https://expo.dev/accounts/steeple/projects/church-phone/builds/3488139c-54da-4381-bdb3-945d2107ef17

Summary

Building with a custom yarn version seems to have broken with 3.3.0.

eas.json:

{
  "cli": {
    "version": ">= 3.3.2",
    "appVersionSource": "remote"
  },
  "build": {
    "base": {
      "channel": "base",
      "node": "16.19.0",
      "yarn": "3.3.1",
      "android": {
        "image": "latest"
      },
      "ios": {
        "image": "latest",
        "resourceClass": "m1-medium"
      }
    },
    "dev": {
      "extends": "base",
      "channel": "dev",
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "image": "latest",
        "resourceClass": "m1-medium"
      }
    }
  }
}

Managed or bare?

bare (prebuild)

Environment

  expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 13.1
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
      Yarn: 3.3.1 - ~/.nvm/versions/node/v16.19.0/bin/yarn
      npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
    Managers:
      CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    IDEs:
      Android Studio: Dolphin 2021.3.1 Patch 1 Dolphin 2021.3.1 Patch 1
      Xcode: 14.2/14C18 - /usr/bin/xcodebuild
    npmGlobalPackages:
      eas-cli: 3.3.2
    Expo Workflow: bare
 Some dependencies are incompatible with the installed expo package version:
 - @react-native-community/netinfo - expected version: 9.3.5 - actual version installed: 9.3.6
 - expo-modules-core - expected version: ~1.0.4 || ~1.1.1 - actual version installed: 1.1.0
 - react - expected version: 18.1.0 - actual version installed: 18.2.0
 - react-dom - expected version: 18.1.0 - actual version installed: 18.2.0
 - react-native - expected version: 0.70.5 - actual version installed: 0.70.6
 - react-native-pager-view - expected version: 6.0.1 - actual version installed: 6.1.1
 - react-native-reanimated - expected version: ~2.12.0 - actual version installed: 2.13.0
 - react-native-svg - expected version: 13.4.0 - actual version installed: 13.6.0
 - react-native-webview - expected version: 11.23.1 - actual version installed: 11.24.0
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo doctor --fix-dependencies,
or install individual packages by running expo install [package-name ...]

Error output

Installing node v16.13.2
Downloading and installing node v16.13.2...
[stderr] Downloading https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.xz...
[stderr] #=#=#
[stderr] ################
[stderr] 23.5%
[stderr] ######################################################################## 100.0%
[stderr] 
[stderr] Computing checksum with sha256sum
[stderr] Checksums matched!
Now using node v16.13.2 (npm v8.1.2)
added 2 packages, and changed 143 packages in 23s
12 packages are looking for funding
  run `npm fund` for details
[stderr] npm notice 
[stderr] npm notice New major version of npm available! 8.19.2 -> 9.3.0
[stderr] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.3.0>
[stderr] npm notice
[stderr] Run `npm install -g npm@9.3.0` to update!
[stderr] npm notice
Installing yarn@3.2.2
[stderr] npm ERR!
[stderr] code ETARGET
[stderr] npm
[stderr] ERR! notarget No matching version found for yarn@3.2.2.
[stderr] npm ERR! notarget In most cases you or one of your dependencies are requesting
[stderr] npm ERR!
[stderr] notarget a package version that doesn't exist.
[stderr] 
[stderr] npm ERR! A complete log of this run can be found in:
[stderr] npm ERR!     /home/expo/.npm/_logs/2023-01-16T19_15_56_423Z-debug-0.log
Failed to install Yarn 3.2.2
npm exited with non-zero code: 1
Error: Failed to install Yarn. Make sure you specified the correct version in eas.json.

Reproducible demo or steps to reproduce from a blank project

Add a yarn 3 version to your eas.json. I have tried several version, all fail.

wkozyra95 commented 1 year ago

The error message is correct, there is no such version. yarn 2 and yarn 3 is sth you configure in your project. yarn that is installed globally should be 1.x.x

izakfilmalter commented 1 year ago

@wkozyra95 The problem is I was able to do this on previous versions of EAS. It might have been using yarn 1, but it didn't error when you had yarn 3.

wkozyra95 commented 1 year ago

I find it very unlikely, you can check on https://www.npmjs.com/package/yarn?activeTab=versions that there is no such version, I do not see a way where specifying 3.x.x version for yarn in eas.json would work.

The project you linked does not have any successful builds, and the other project does not use a custom yarn version. Can you link to a build where that worked?

izakfilmalter commented 1 year ago

Here is a build that is successful using the following eas.config: https://expo.dev/accounts/steeple/projects/krew/builds/0b5b3087-358e-42e5-9b9d-35e3284ec814

{
  "cli": {
    "version": ">= 1.1.1",
    "appVersionSource": "remote"
  },
  "build": {
    "base": {
      "node": "16.13.0",
      "yarn": "3.2.2",
      "android": {
        "image": "ubuntu-18.04-jdk-11-ndk-r19c"
      }
    },
    "dev-local-sim": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "simulator": true
      }
    },
    "dev-local": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "prod-local": {
      "extends": "dev-local"
    },
    "preview": {
      "env": {
        "RELEASE": "true",
        "FLIPPER_DISABLE": "1"
      },
      "distribution": "internal",
      "channel": "preview"
    },
    "production": {
      "autoIncrement": true,
      "env": {
        "RELEASE": "true",
        "FLIPPER_DISABLE": "1"
      },
      "channel": "production"
    }
  },
}
wkozyra95 commented 1 year ago

This build is using dev-local profile. This profile does not extend base profile so yarn and node are not specified there.

izakfilmalter commented 1 year ago

So what is the right pathway to use yarn berry for eas then? https://github.com/yarnpkg/berry

This is where v2 and v3 of yarn is located.

wkozyra95 commented 1 year ago

It's the same as you use it locally there is nothing EAS specific here, yarn v2 and v3 are installed in your project. Globally installed yarn v1 is just bootstrapping the project.

tyeetale commented 7 months ago

Sorry to continue the conversation, but @wkozyra95 does EAS not support yarn modern (2+) at all without custom hook? I extended my eas.json specifying yarn@4.1.1 but eas build doesn't work.

sdemoor commented 3 months ago

@tyeetale I added this command to my package.json scripts which fixed it: "eas-build-pre-install": "corepack enable && corepack prepare yarn@4.1.1 --activate"

aidenwithu commented 3 months ago

you can and .yarnrc.yml, if your local project has .yarn directory, it will also be upload. the file content is

nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.6.1.cjs
matthewcaminiti commented 1 month ago

@tyeetale I added this command to my package.json scripts which fixed it: "eas-build-pre-install": "corepack enable && corepack prepare yarn@4.1.1 --activate"

This worked perfectly for me (with yarn@4.5.0), thank you very much @sdemoor ! For future readers, can check out docs