Exit Code 1 / Exit Code 2

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

I am attempting to deploy em-bd.netlify.app](https://em-bd.netlify.app/

I was originally getting exit code 1. I reinstalled my .lock and node_modules and updated what modules I was able. I then installed cacache because I saw that was one of the final errors. Following that with adding environment variables NPM_FLAGS to --legacy-peer-deps and CI to “false”.

It still will not build.

6:03:04 PM: Build ready to start
6:03:07 PM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
6:03:07 PM: build-image tag: v4.10.1
6:03:07 PM: buildbot version: 37262c48b1f3cfa88c6caed707d29b19aef6a5a7
6:03:07 PM: Fetching cached dependencies
6:03:07 PM: Failed to fetch cache, continuing with build
6:03:07 PM: Starting to prepare the repo for build
6:03:08 PM: No cached dependencies found. Cloning fresh repo
6:03:08 PM: git clone https://github.com/th2n10s4u/embd-website
6:03:08 PM: Preparing Git Reference refs/heads/master
6:03:09 PM: Parsing package.json dependencies
6:03:10 PM: Starting build script
6:03:10 PM: Installing dependencies
6:03:10 PM: Python version set to 2.7
6:03:10 PM: Downloading and installing node v16.17.0...
6:03:10 PM: Downloading https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz...
6:03:11 PM: Computing checksum with sha256sum
6:03:11 PM: Checksums matched!
6:03:13 PM: Now using node v16.17.0 (npm v8.15.0)
6:03:13 PM: Started restoring cached build plugins
6:03:13 PM: Finished restoring cached build plugins
6:03:13 PM: Attempting ruby version 2.7.2, read from environment
6:03:14 PM: Using ruby version 2.7.2
6:03:14 PM: Using PHP version 8.0
6:03:14 PM: No npm workspaces detected
6:03:14 PM: Started restoring cached node modules
6:03:14 PM: Finished restoring cached node modules
6:03:14 PM: Installing NPM modules using NPM version 8.15.0
6:03:15 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
6:03:15 PM: npm WARN config location in the cache, and they are managed by
6:03:15 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
6:03:15 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
6:03:15 PM: npm WARN config location in the cache, and they are managed by
6:03:15 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
6:03:20 PM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
6:03:20 PM: npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
6:03:21 PM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
6:03:21 PM: npm WARN deprecated topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
6:03:21 PM: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
6:03:21 PM: npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
6:03:22 PM: npm WARN deprecated sane@2.5.2: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
6:03:22 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
6:03:22 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
6:03:22 PM: npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
6:03:22 PM: npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
6:03:22 PM: npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
6:03:23 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
6:03:23 PM: npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
6:03:23 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
6:03:23 PM: npm WARN deprecated html-webpack-plugin@4.0.0-alpha.2: please switch to a stable version
6:03:23 PM: npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
6:03:23 PM: npm WARN deprecated joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
6:03:23 PM: npm WARN deprecated eslint-loader@2.1.1: This loader has been deprecated. Please use eslint-webpack-plugin
6:03:24 PM: npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
6:03:24 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
6:03:24 PM: npm WARN deprecated acorn-dynamic-import@3.0.0: This is probably built in to whatever tool you're using. If you still need it... idknpm WARN deprecated babel-eslint@9.0.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
6:03:28 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
6:03:28 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
6:03:30 PM: npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
6:03:30 PM: npm WARN deprecated core-js@2.6.4: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
6:03:36 PM: added 2241 packages, and audited 2242 packages in 21s
6:03:36 PM: 94 packages are looking for funding
6:03:36 PM:   run `npm fund` for details
6:03:36 PM: 74 vulnerabilities (14 low, 20 moderate, 36 high, 4 critical)
6:03:36 PM: To address issues that do not require attention, run:
6:03:36 PM:   npm audit fix
6:03:36 PM: To address all issues (including breaking changes), run:
6:03:36 PM:   npm audit fix --force
6:03:36 PM: Run `npm audit` for details.
6:03:36 PM: NPM modules installed
6:03:36 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
6:03:36 PM: npm WARN config location in the cache, and they are managed by
6:03:36 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
6:03:36 PM: Started restoring cached go cache
6:03:36 PM: Finished restoring cached go cache
6:03:36 PM: Installing Go version 1.17 (requested 1.17)
6:03:41 PM: unset GOOS;
6:03:41 PM: unset GOARCH;
6:03:41 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
6:03:41 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
6:03:41 PM: go version >&2;
6:03:41 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
6:03:41 PM: go version go1.17 linux/amd64
6:03:41 PM: Installing missing commands
6:03:41 PM: Verify run directory
6:03:42 PM: ​
6:03:42 PM: ────────────────────────────────────────────────────────────────
6:03:42 PM:   Netlify Build                                                 
6:03:42 PM: ────────────────────────────────────────────────────────────────
6:03:42 PM: ​
6:03:42 PM: ❯ Version
6:03:42 PM:   @netlify/build 27.17.1
6:03:42 PM: ​
6:03:42 PM: ❯ Flags
6:03:42 PM:   baseRelDir: true
6:03:42 PM:   buildId: 63193f481576dd0a4af45e9b
6:03:42 PM:   deployId: 63193f481576dd0a4af45e9d
6:03:42 PM: ​
6:03:42 PM: ❯ Current directory
6:03:42 PM:   /opt/build/repo
6:03:42 PM: ​
6:03:42 PM: ❯ Config file
6:03:42 PM:   No config file was defined: using default values.
6:03:42 PM: ​
6:03:42 PM: ❯ Context
6:03:42 PM:   production
6:03:42 PM: ​
6:03:42 PM: ────────────────────────────────────────────────────────────────
6:03:42 PM:   1. Build command from Netlify app                             
6:03:42 PM: ────────────────────────────────────────────────────────────────
6:03:42 PM: ​
6:03:42 PM: $ npm run build
6:03:42 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
6:03:42 PM: npm WARN config location in the cache, and they are managed by
6:03:42 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
6:03:42 PM: > embd-website@0.1.0 build
6:03:42 PM: > react-scripts build
6:03:43 PM: Creating an optimized production build...
6:03:45 PM: Failed to compile.
6:03:45 PM: 
6:03:45 PM: ./src/App.js
6:03:45 PM: Cannot find file './assets/components/ServicePages/SocialDance.js' in './src'.
6:03:45 PM: ​
6:03:45 PM: ────────────────────────────────────────────────────────────────
6:03:45 PM:   "build.command" failed                                        
6:03:45 PM: ────────────────────────────────────────────────────────────────
6:03:45 PM: ​
6:03:45 PM:   Error message
6:03:45 PM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
6:03:45 PM: ​
6:03:45 PM:   Error location
6:03:45 PM:   In Build command from Netlify app:
6:03:45 PM:   npm run build
6:03:45 PM: ​
6:03:45 PM:   Resolved config
6:03:45 PM:   build:
6:03:45 PM:     command: npm run build
6:03:45 PM:     commandOrigin: ui
6:03:45 PM:     environment:
6:03:45 PM:       - CI
6:03:45 PM:       - NPM_FLAGS
6:03:45 PM:     publish: /opt/build/repo/build
6:03:45 PM:     publishOrigin: ui
6:03:45 PM: Caching artifacts
6:03:45 PM: Started saving node modules
6:03:45 PM: Finished saving node modules
6:03:45 PM: Started saving build plugins
6:03:45 PM: Finished saving build plugins
6:03:45 PM: Started saving pip cache
6:03:45 PM: Finished saving pip cache
6:03:45 PM: Started saving emacs cask dependencies
6:03:45 PM: Finished saving emacs cask dependencies
6:03:45 PM: Started saving maven dependencies
6:03:45 PM: Finished saving maven dependencies
6:03:45 PM: Started saving boot dependencies
6:03:45 PM: Finished saving boot dependencies
6:03:45 PM: Started saving rust rustup cache
6:03:45 PM: Finished saving rust rustup cache
6:03:45 PM: Started saving go dependencies
6:03:45 PM: Finished saving go dependencies
6:03:46 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:03:46 PM: Creating deploy upload records
6:03:46 PM: Failing build: Failed to build site
6:03:46 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
6:03:46 PM: Finished processing build request in 39.301994355s

Edit: Added most recent build log.

Hey @th2n10s4u

Quite possible this is caused by case sensitivity

As the repository is private, I can’t tell for sure.

@coelmay
I had previously read the case sensitivity post and had changed some file names to attempt the fix. I am unsure why the case would be an issue though as all my file names are consistent. Maybe I am missing something so I will temporarily make the repository public.
Thank you for the reply!

I pushed and commited git config core.ignorecase false to the repository and it solved the problem. Thanks for your time @coelmay

1 Like

Thanks for coming back and letting us know, @th2n10s4u! Glad everything is working now.