eas-cli icon indicating copy to clipboard operation
eas-cli copied to clipboard

Force npm instead of yarn during prebuild phase of eas build?

Open Joshuapwilley opened this issue 4 years ago • 5 comments

Is there a way to force the prebuild stage of eas build to use the "--npm" option to apply this workaround?

Without "--npm": image

With "--npm": image

I realize I run expo prebuild in these examples but I think it illustrates the issue cleanly.

My actual issue is this (I want to be able to pass --npm here, I guess?): eas build --profile my-profile -p android --local --clear-cache image

I fully admit that I may be missing something here so if I am, please point me in the direction of it!

Joshuapwilley avatar Feb 03 '22 20:02 Joshuapwilley

Disregard! You are able to do this via eas.json.

For example:

{
  "build": {
    "base-local": {
      "node": "12.22.5",
      "developmentClient": true,
      "prebuildCommand": "prebuild --npm",
      ...
    }
  }
}

Closing this issue.

Joshuapwilley avatar Feb 03 '22 21:02 Joshuapwilley

isn't there a way for eas build -p android --profile preview to run npm i --force? or npm config set legacy-peer-deps true or npm install --save --legacy-peer-deps?

EmePin avatar Jun 29 '24 02:06 EmePin

@EmePin Did you find a way with customizing the npm command? Am stuck and that is exactly what I need to do

osamwelian3 avatar Feb 25 '25 18:02 osamwelian3

@EmePin @osamwelian3 From https://stackoverflow.com/questions/73933728/how-to-tell-expo-to-install-npm-dependencies-with-legacy-peerdeps-option#answer-74268002

  1. Create a .npmrc file in the project root and add force=true or legacy-peer-deps=true
  2. In package.json, add "eas-build-pre-install": "npm config set legacy-peer-deps true" to scripts

VolkerLieber avatar Mar 27 '25 16:03 VolkerLieber

@EmePin @osamwelian3 From stackoverflow.com/questions/73933728/how-to-tell-expo-to-install-npm-dependencies-with-legacy-peerdeps-option#answer-74268002

  1. Create a .npmrc file in the project root and add force=true or legacy-peer-deps=true
  2. In package.json, add "eas-build-pre-install": "npm config set legacy-peer-deps true" to scripts

Thanks, it worked here.

izakdvlpr avatar May 09 '25 17:05 izakdvlpr