Home
Support Forums

Bash: expo:build: command not found

Hi,

My local Netlify build for an expo project is working fine, but the continuous deployment fails.
Build command: expo:build
Publish directory: web-build

bash: expo:build: command not found
I’ve seen this problem here in the community. The suggestion has been to make sure exo-cli is added to the package.json. I’ve included the expo-cli, but I get the same error. Why can’t Netlify find the expo command? Thanks!!

────────────────────────────────────────────────────────────────
4:54:20 PM: Netlify Build
4:54:20 PM: ────────────────────────────────────────────────────────────────
4:54:20 PM: ​
4:54:20 PM: ❯ Version
4:54:20 PM: @netlify/build 9.1.3
4:54:20 PM: ​
4:54:20 PM: ❯ Flags
4:54:20 PM: deployId: 602eefd0e34c5700b68be888
4:54:20 PM: mode: buildbot
4:54:20 PM: ​
4:54:20 PM: ❯ Current directory
4:54:20 PM: /opt/build/repo
4:54:20 PM: ​
4:54:20 PM: ❯ Config file
4:54:20 PM: No config file was defined: using default values.
4:54:20 PM: ​
4:54:20 PM: ❯ Context
4:54:20 PM: production
4:54:20 PM: ​
4:54:20 PM: ────────────────────────────────────────────────────────────────
4:54:20 PM: 1. Build command from Netlify app
4:54:20 PM: ────────────────────────────────────────────────────────────────
4:54:20 PM: ​
4:54:20 PM: $ expo:build
4:54:20 PM: bash: expo:build: command not found
4:54:20 PM: ​
4:54:20 PM: ────────────────────────────────────────────────────────────────
4:54:20 PM: β€œbuild.command” failed
4:54:20 PM: ────────────────────────────────────────────────────────────────
4:54:20 PM: ​
4:54:20 PM: Error message
4:54:20 PM: Command failed with exit code 127: expo:build
4:54:20 PM: ​
4:54:20 PM: Error location
4:54:20 PM: In Build command from Netlify app:
4:54:20 PM: expo:build
4:54:20 PM: ​
4:54:20 PM: Resolved config
4:54:20 PM: build:
4:54:20 PM: command: expo:build
4:54:20 PM: commandOrigin: ui
4:54:20 PM: publish: /opt/build/repo/web-build
4:54:20 PM: Caching artifacts
4:54:20 PM: Started saving node modules
4:54:20 PM: Finished saving node modules
4:54:20 PM: Started saving build plugins
4:54:20 PM: Finished saving build plugins
4:54:20 PM: Started saving pip cache
4:54:20 PM: Finished saving pip cache
4:54:20 PM: Started saving emacs cask dependencies
4:54:20 PM: Finished saving emacs cask dependencies
4:54:20 PM: Started saving maven dependencies
4:54:20 PM: Finished saving maven dependencies
4:54:20 PM: Started saving boot dependencies
4:54:20 PM: Finished saving boot dependencies
4:54:20 PM: Started saving rust rustup cache
4:54:20 PM: Finished saving rust rustup cache
4:54:20 PM: Started saving go dependencies
4:54:20 PM: Finished saving go dependencies
4:54:23 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:54:23 PM: Failing build: Failed to build site
4:54:23 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
4:54:23 PM: Finished processing build request in 1m16.701072436s

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile:

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

Thanks Perry, I’ve been through the support guide and looked at other posts. The build commands I listed above. Here is my package.json. Thanks

{
β€œmain”: β€œnode_modules/expo/AppEntry.js”,
β€œscripts”: {
β€œstart”: β€œexpo start”,
β€œandroid”: β€œexpo start --android”,
β€œios”: β€œexpo start --ios”,
β€œweb”: β€œexpo start --web”,
β€œeject”: β€œexpo eject”
},
β€œdependencies”: {
β€œexpo”: β€œ~40.0.0”,
β€œexpo-cli”: β€œ^4.1.6”,
β€œexpo-status-bar”: β€œ~1.0.3”,
β€œreact”: β€œ16.13.1”,
β€œreact-dom”: β€œ16.13.1”,
β€œreact-native”: β€œhttps://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz”,
β€œreact-native-svg”: β€œ12.1.0”,
β€œreact-native-web”: β€œ~0.13.12”
},
β€œdevDependencies”: {
β€œ@babel/core”: β€œ~7.9.0”
},
β€œprivate”: true
}

hi @tunatuna , you have your build command set to expo:build but there is no script called expo in your scripts section of your package.json file.

Ah thanks! Actually didn’t need to add it to scripts. expo:build is not the correct command its: expo build:web

thanks for the fast response!!