Deploy failed : Express app : Deploy did not succeed: Deploy directory 'dist' does not exist

────────────────────────────────────────────────────────────────
2:54:46 AM:   3. Deploy site                                                
2:54:46 AM: ────────────────────────────────────────────────────────────────
2:54:46 AM: ​
2:54:46 AM: ​
2:54:46 AM: ────────────────────────────────────────────────────────────────
2:54:46 AM:   Configuration error                                           
2:54:46 AM: ────────────────────────────────────────────────────────────────
2:54:46 AM: ​
2:54:46 AM:   Error message
2:54:46 AM:   Deploy did not succeed: Deploy directory 'dist' does not exist
2:54:46 AM: ​
2:54:46 AM:   Resolved config
2:54:46 AM:   build:
2:54:46 AM:     command: npm install && npm run build
2:54:46 AM:     commandOrigin: config
2:54:46 AM:     publish: /opt/build/repo/dist
2:54:46 AM:   functionsDirectory: /opt/build/repo/functions
2:54:47 AM: Caching artifacts
2:54:47 AM: Started saving node modules
2:54:47 AM: Finished saving node modules
2:54:47 AM: Started saving build plugins
2:54:47 AM: Finished saving build plugins
2:54:47 AM: Started saving pip cache
2:54:47 AM: Finished saving pip cache
2:54:47 AM: Started saving emacs cask dependencies
2:54:47 AM: Finished saving emacs cask dependencies
2:54:47 AM: Started saving maven dependencies
2:54:47 AM: Finished saving maven dependencies
2:54:47 AM: Started saving boot dependencies
2:54:47 AM: Finished saving boot dependencies
2:54:47 AM: Started saving rust rustup cache
2:54:47 AM: Finished saving rust rustup cache
2:54:47 AM: Started saving go dependencies
2:54:47 AM: Finished saving go dependencies
2:54:49 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:54:49 AM: Creating deploy upload records
2:54:49 AM: Failing build: Failed to build site
2:54:49 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
2:54:49 AM: Finished processing build request in 48.531446406s

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 for help.

I had to clear Publish Directory under Build Setting to make it work.