Deploy directory '_site' does not exist

1:28:40 AM: ────────────────────────────────────────────────────────────────
1:28:40 AM: Netlify Build
1:28:40 AM: ────────────────────────────────────────────────────────────────
1:28:40 AM: ​
1:28:40 AM: ❯ Version
1:28:40 AM: @netlify/build 27.1.3
1:28:40 AM: ​
1:28:40 AM: ❯ Flags
1:28:40 AM: baseRelDir: true
1:28:40 AM: buildId: 62908b7dc119eb7ac733de6e
1:28:40 AM: deployId: 62908b7dc119eb7ac733de70
1:28:40 AM: ​
1:28:40 AM: ❯ Current directory
1:28:40 AM: /opt/build/repo
1:28:40 AM: ​
1:28:40 AM: ❯ Config file
1:28:40 AM: No config file was defined: using default values.
1:28:40 AM: ​
1:28:40 AM: ❯ Context
1:28:40 AM: production
1:28:40 AM: ​
1:28:40 AM: ────────────────────────────────────────────────────────────────
1:28:40 AM: 1. Build command from Netlify app
1:28:40 AM: ────────────────────────────────────────────────────────────────
1:28:40 AM: ​
1:28:40 AM: $ npm run build
1:28:41 AM: > Anddhen@0.1.0 build
1:28:41 AM: > react-scripts build
1:28:42 AM: Creating an optimized production build…
1:28:58 AM: Compiled successfully.
1:28:58 AM:
1:28:58 AM: File sizes after gzip:
1:28:58 AM: 74.43 kB build/static/js/main.9f2dde48.js
1:28:58 AM: 24.52 kB build/static/css/main.ece1e8c1.css
1:28:58 AM: 1.78 kB build/static/js/787.f825f7e8.chunk.js
1:28:58 AM: The project was built assuming it is hosted at /.
1:28:58 AM: You can control this with the homepage field in your package.json.
1:28:58 AM: The build folder is ready to be deployed.
1:28:58 AM: You may serve it with a static server:
1:28:58 AM: npm install -g serve
1:28:58 AM: serve -s build
1:28:58 AM: Find out more about deployment here:
1:28:58 AM: Deployment | Create React App
1:28:58 AM: ​
1:28:58 AM: (build.command completed in 17.9s)
1:28:58 AM: ​
1:28:58 AM: ────────────────────────────────────────────────────────────────
1:28:58 AM: 2. Deploy site
1:28:58 AM: ────────────────────────────────────────────────────────────────
1:28:58 AM: ​
1:28:58 AM: ​
1:28:58 AM: ────────────────────────────────────────────────────────────────
1:28:58 AM: Configuration error
1:28:58 AM: ────────────────────────────────────────────────────────────────
1:28:58 AM: ​
1:28:58 AM: Error message
1:28:58 AM: Deploy did not succeed: Deploy directory ‘_site’ does not exist
1:28:58 AM: ​
1:28:58 AM: Resolved config
1:28:58 AM: build:
1:28:58 AM: command: npm run build
1:28:58 AM: commandOrigin: ui
1:28:58 AM: publish: /opt/build/repo/_site
1:28:58 AM: publishOrigin: ui
1:28:58 AM: Caching artifacts
1:28:58 AM: Started saving node modules
1:28:58 AM: Finished saving node modules
1:28:58 AM: Started saving build plugins
1:28:58 AM: Finished saving build plugins
1:28:58 AM: Started saving pip cache
1:28:59 AM: Finished saving pip cache
1:28:59 AM: Started saving emacs cask dependencies
1:28:59 AM: Finished saving emacs cask dependencies
1:28:59 AM: Started saving maven dependencies
1:28:59 AM: Finished saving maven dependencies
1:28:59 AM: Started saving boot dependencies
1:28:59 AM: Finished saving boot dependencies
1:28:59 AM: Started saving rust rustup cache
1:28:59 AM: Finished saving rust rustup cache
1:28:59 AM: Started saving go dependencies
1:28:59 AM: Finished saving go dependencies
1:29:00 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:29:00 AM: Creating deploy upload records
1:29:00 AM: Failing build: Failed to build site
1:29:01 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
1:29:01 AM: Finished processing build request in 1m17.639227238s

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: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

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, a link to your site, your package.json, etc. Thanks!