npm install error when EAS build IOS

eas build --platform ios --profile prod keep throwing the error below. I spent quite some time re-searching but none of the answers i found helped.

Here are some of things I tried:

  1. deleted node_module and package-lock.json, and npm install afterwards
  2. npx clear-npx-cache
  3. downgrading expo version to 46
    etc…

Hi @naina-lele

This seems to be a bug in npm related to peer dependencies.

See my comment on a related thread for a workaround:

Thank you @wodin , not sure if it’s a smart work around but adding "eas-build-pre-install": "npm config set legacy-peer-deps true" to script fixed my issue. The issue was def with npm related to peer dependencies.