# Netlify deploy fails at build phase. Please help deploy my site

**URL:** <https://answers.netlify.com/t/netlify-deploy-fails-at-build-phase-please-help-deploy-my-site/97460>\
**Category:** Support\
**Tags:** building, netlify-newbie, gatsby, deployment\
**Created:** [July 25, 2023, 1:38am UTC](https://answers.netlify.com/t/netlify-deploy-fails-at-build-phase-please-help-deploy-my-site/97460 "2023-07-25T01:38:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![awesome7](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@awesome7](https://answers.netlify.com/u/awesome7)\
**Post date:** [July 25, 2023, 1:38am UTC](https://answers.netlify.com/t/netlify-deploy-fails-at-build-phase-please-help-deploy-my-site/97460/1 "2023-07-25T01:38:50Z")

</div>

My Build log says

6:57:49 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](https://ntl.fyi/exit-code-2))  
6:57:46 AM: failed Building production JavaScript and CSS bundles - 8.364s  
6:57:46 AM: error Generating JavaScript bundles failed  
6:57:46 AM: Can’t resolve ‘gatsby-background-image’ in ‘/opt/build/repo/src/components/Reusable’  
6:57:46 AM: If you’re trying to use a package make sure that ‘gatsby-background-image’ is installed. If you’re trying to use a local file make sure that the path is correct.  
6:57:47 AM: ​  
6:57:47 AM: build.command failed  
6:57:47 AM: ────────────────────────────────────────────────────────────────  
6:57:47 AM: ​  
6:57:47 AM: Error message  
6:57:47 AM: Command failed with exit code 1: npm run build ([Search results for '"non-zero exit code: 1"' - Netlify Support Forums](https://ntl.fyi/exit-code-1))  
6:57:47 AM: ​  
6:57:47 AM: Error location  
6:57:47 AM: In Build command from Netlify app:  
6:57:47 AM: npm run build  
6:57:47 AM: ​  
6:57:47 AM: Resolved config  
6:57:47 AM: build:  
6:57:47 AM: command: npm run build  
6:57:47 AM: commandOrigin: ui  
6:57:47 AM: environment:  
6:57:47 AM: - CONTENTFUL\_ACCESS\_TOKEN  
6:57:47 AM: - CONTENTFUL\_SPACE\_ID  
6:57:47 AM: - SNIPCART\_KEY  
6:57:47 AM: publish: /opt/build/repo/public  
6:57:47 AM: publishOrigin: ui  
6:57:47 AM: plugins:  
6:57:47 AM: - inputs: {}  
6:57:47 AM: origin: ui  
6:57:47 AM: package: ‘@netlify/plugin-gatsby’  
6:57:49 AM: Build failed due to a user error: Build script returned non-zero exit code: 2  
6:57:49 AM: Failing build: Failed to build site  
6:57:49 AM: Finished processing build request in 1m6.257s

---

<div class="post-metadata">

**Author:** ![SamO](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/samo/32/41847_2.png) [@SamO](https://answers.netlify.com/u/SamO)\
**Post date:** [July 25, 2023, 1:24pm UTC](https://answers.netlify.com/t/netlify-deploy-fails-at-build-phase-please-help-deploy-my-site/97460/2 "2023-07-25T13:24:03Z")

</div>

Hi there, glad you found us 👋🏿 before we can help you, we need a little more information on the issues you are facing.

First, have you looked through [this resource](https://answers.netlify.com/t/support-guide-compiled-build-and-deploy-resources-start-here/50679)? It is a compilation of all of our build and deploy resources. This is a good starting point.

If you have worked through those guides and are still encountering issues please share the following information:

- the name of your build instance: “[example-jones.netlify.com](http://example-jones.netlify.com)”
- what you have already tried
- any error messages you have received in your terminal window or in the developer console
