EAS Build Failed due to eas-build-pre-install permission denied while running bash command

  • Managed (dev-client) workflow
  • eas-cli/2.7.1 darwin-x64 node-v16.15.1

I’m trying to run the bash command for generating the sourcemap to upload to a self hosted sentry (FYI I’m not using the expo-sentry). As per Build Lifecycle Hook

  1. I added following in package.json> scripts
    "eas-build-pre-install": "./pre-install",  
    "eas-build-post-install": "./post-install"
  1. Added pre-install and post-install file with following content same as in Documentation

# This is a file called "pre-install" in the root of the project

if [[ "$EAS_BUILD_PLATFORM" == "android" ]]; then
  echo "Run commands for Android builds here"
elif [[ "$EAS_BUILD_PLATFORM" == "ios" ]]; then
  echo "Run commands for iOS builds here"

  1. I run eas build and got following error

[stderr] /bin/sh: ./scripts/post-install: Permission denied

(getting same for both pre-install and post-install hook. Following screenshot was when I tried just with the post install hook.)

Your script needs to have executable permission

Run chmod +x post-install locally and build again


change entry in package.json to

 "eas-build-pre-install": "bash pre-install"

Thank you so much it worked.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.