Gatsby build failed - globalThis is not defined

Hello!

I’m trying to deploy changes to my website built with Gatsby. It builds on my local machine, but when I try to deploy it to production it fails with message:

3:17:21 PM:   1. Build command from Netlify app                             
3:17:21 PM: ────────────────────────────────────────────────────────────────
3:17:21 PM: ​
3:17:21 PM: $ npm run build
3:17:21 PM: > ripatrip-gatsby-site@0.1.0 build /opt/build/repo/web
3:17:21 PM: > gatsby build
3:17:25 PM: error gatsby build
3:17:25 PM: Build a Gatsby project.
3:17:25 PM: Options:
3:17:25 PM:   --verbose                   Turn on verbose output  [boolean] [default: false]
3:17:25 PM:   --no-color, --no-colors     Turn off the color in output  [boolean] [default: false]
3:17:25 PM:   --json                      Turn on the JSON logger  [boolean] [default: false]
3:17:25 PM:   --prefix-paths              Build site with link paths prefixed with the pathPrefix value in gatsby-config.js. Default is env.PREFIX_PATHS or false.  [boolean] [default: false]
3:17:25 PM:   --no-uglify                 Build site without uglifying JS bundles (for debugging).  [boolean] [default: false]
3:17:25 PM:   --profile                   Build site with react profiling (this can add some additional overhead). See https://reactjs.org/docs/profiler  [boolean] [default: false]
3:17:25 PM:   --graphql-tracing           Trace every graphql resolver, may have performance implications  [boolean] [default: false]
3:17:25 PM:   --open-tracing-config-file  Tracer configuration file (OpenTracing compatible). See https://gatsby.dev/tracing  [string]
3:17:25 PM:   -h, --help                  Show help  [boolean]
3:17:25 PM:   -v, --version               Show the version of the Gatsby CLI and the Gatsby package in the current project  [boolean]
3:17:25 PM: error There was a problem loading the local build command. Gatsby may not be installed. Perhaps you need to run "npm install"? globalThis is not defined
3:17:25 PM: 
3:17:25 PM: 
3:17:25 PM:   ReferenceError: globalThis is not defined

It worked a few months ago, just fixed a few lines and didn’t update any packages, so seems really weird… Have no idea where to look. I’ve tried different node environments.

Full build log below →

 3:15:10 PM: Build ready to start
3:15:12 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
3:15:12 PM: build-image tag: v3.6.1
3:15:12 PM: buildbot version: 84797942a921f1c638bb743029b0d17c8e0112bd
3:15:12 PM: Fetching cached dependencies
3:15:12 PM: Failed to fetch cache, continuing with build
3:15:12 PM: Starting to prepare the repo for build
3:15:13 PM: No cached dependencies found. Cloning fresh repo
3:15:13 PM: git clone https://github.com/jdelos/rip-a-trip
3:15:18 PM: Preparing Git Reference refs/heads/master
3:15:20 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'web/public' versus 'public' in the Netlify UI
3:15:20 PM: Starting build script
3:15:20 PM: Installing dependencies
3:15:20 PM: Python version set to 2.7
3:15:22 PM: Downloading and installing node v12.2.0...
3:15:22 PM: Downloading https://nodejs.org/dist/v12.2.0/node-v12.2.0-linux-x64.tar.xz...
3:15:22 PM: Computing checksum with sha256sum
3:15:22 PM: Checksums matched!
3:15:24 PM: Now using node v12.2.0 (npm v6.9.0)
3:15:24 PM: Started restoring cached build plugins
3:15:24 PM: Finished restoring cached build plugins
3:15:25 PM: Attempting ruby version 2.6.2, read from environment
3:15:26 PM: Using ruby version 2.6.2
3:15:26 PM: Using PHP version 5.6
3:15:26 PM: Started restoring cached node modules
3:15:26 PM: Finished restoring cached node modules
3:15:26 PM: Installing NPM modules using NPM version 6.9.0
3:15:28 PM: npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
3:15:28 PM: npm WARN deprecated fingerprintjs2@2.1.4: Package has been renamed to @fingerprintjs/fingerprintjs. Install @fingerprintjs/fingerprintjs to get updates.
3:15:29 PM: npm WARN deprecated gatsby-image@2.11.0: This package has been deprecated in favor of gatsby-plugin-image. The migration guide can be found here: https://www.gatsbyjs.com/docs/reference/release-notes/image-migration-guide/.
3:15:32 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
3:15:32 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
3:15:34 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
3:15:34 PM: npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
3:15:35 PM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
3:15:36 PM: npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
3:15:37 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).
3:15:38 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
3:15:39 PM: npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
3:15:41 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
3:15:41 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
3:15:41 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
3:15:41 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
3:15:42 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).
3:15:42 PM: npm WARN deprecated cheerio-select-tmp@0.1.1: Use cheerio-select instead
3:15:42 PM: npm WARN deprecated axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
3:15:47 PM: npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
3:15:48 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).
3:15:48 PM: npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
3:15:48 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
3:15:50 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
3:16:42 PM: > node@11.15.0 preinstall /opt/build/repo/web/node_modules/node
3:16:42 PM: > node installArchSpecificPackage
3:16:45 PM: + node-linux-x64@11.15.0
3:16:45 PM: added 1 package in 2.53s
3:16:45 PM: found 0 vulnerabilities
3:16:49 PM: > sharp@0.27.2 install /opt/build/repo/web/node_modules/gatsby-plugin-manifest/node_modules/sharp
3:16:49 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
3:16:50 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-linux-x64.tar.br
3:16:53 PM: > sharp@0.27.2 install /opt/build/repo/web/node_modules/gatsby-plugin-sharp/node_modules/sharp
3:16:53 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
3:16:54 PM: info sharp Using cached /opt/buildhome/.npm/_libvips/libvips-8.10.5-linux-x64.tar.br
3:16:56 PM: > sharp@0.27.2 install /opt/build/repo/web/node_modules/gatsby-transformer-sharp/node_modules/sharp
3:16:56 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
3:16:57 PM: info sharp Using cached /opt/buildhome/.npm/_libvips/libvips-8.10.5-linux-x64.tar.br
3:16:59 PM: > node-sass@4.14.1 install /opt/build/repo/web/node_modules/node-sass
3:16:59 PM: > node scripts/install.js
3:17:00 PM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-67_binding.node
3:17:01 PM: Download complete
3:17:01 PM: Binary saved to /opt/build/repo/web/node_modules/node-sass/vendor/linux-x64-67/binding.node
3:17:01 PM: Caching binary to /opt/buildhome/.npm/node-sass/4.14.1/linux-x64-67_binding.node
3:17:01 PM: > sharp@0.25.4 install /opt/build/repo/web/node_modules/sharp
3:17:01 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
3:17:02 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
3:17:05 PM: > @fortawesome/fontawesome-common-types@0.2.34 postinstall /opt/build/repo/web/node_modules/@fortawesome/fontawesome-common-types
3:17:05 PM: > node attribution.js
3:17:05 PM: Font Awesome Free 0.2.34 by @fontawesome - https://fontawesome.com
3:17:05 PM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
3:17:05 PM: > core-js@2.6.12 postinstall /opt/build/repo/web/node_modules/babel-runtime/node_modules/core-js
3:17:05 PM: > node -e "try{require('./postinstall')}catch(e){}"
3:17:05 PM: > core-js-pure@3.9.1 postinstall /opt/build/repo/web/node_modules/core-js-pure
3:17:05 PM: > node -e "try{require('./postinstall')}catch(e){}"
3:17:06 PM: > core-js@3.9.1 postinstall /opt/build/repo/web/node_modules/gatsby/node_modules/core-js
3:17:06 PM: > node -e "try{require('./postinstall')}catch(e){}"
3:17:06 PM: (node:1384) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit
3:17:07 PM: > styled-components@4.4.1 postinstall /opt/build/repo/web/node_modules/styled-components
3:17:07 PM: > node ./scripts/postinstall.js || exit 0
3:17:07 PM: Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
3:17:07 PM: > gatsby-telemetry@1.10.1 postinstall /opt/build/repo/web/node_modules/gatsby-telemetry
3:17:07 PM: > node src/postinstall.js || true
3:17:08 PM: > mozjpeg@7.0.0 postinstall /opt/build/repo/web/node_modules/mozjpeg
3:17:08 PM: > node lib/install.js
3:17:08 PM:   ✔ mozjpeg pre-build test passed successfully
3:17:08 PM: > pngquant-bin@6.0.0 postinstall /opt/build/repo/web/node_modules/pngquant-bin
3:17:08 PM: > node lib/install.js
3:17:09 PM:   ✔ pngquant pre-build test passed successfully
3:17:09 PM: > gatsby-cli@2.19.2 postinstall /opt/build/repo/web/node_modules/gatsby-cli
3:17:09 PM: > node scripts/postinstall.js
3:17:09 PM: > @fortawesome/fontawesome-svg-core@1.2.34 postinstall /opt/build/repo/web/node_modules/@fortawesome/fontawesome-svg-core
3:17:09 PM: > node attribution.js
3:17:09 PM: Font Awesome Free 1.2.34 by @fontawesome - https://fontawesome.com
3:17:09 PM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
3:17:09 PM: > @fortawesome/free-brands-svg-icons@5.15.2 postinstall /opt/build/repo/web/node_modules/@fortawesome/free-brands-svg-icons
3:17:09 PM: > node attribution.js
3:17:09 PM: Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com
3:17:09 PM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
3:17:09 PM: > @fortawesome/free-solid-svg-icons@5.15.2 postinstall /opt/build/repo/web/node_modules/@fortawesome/free-solid-svg-icons
3:17:09 PM: > node attribution.js
3:17:09 PM: Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com
3:17:09 PM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
3:17:09 PM: > gatsby@2.32.9 postinstall /opt/build/repo/web/node_modules/gatsby
3:17:09 PM: > node scripts/postinstall.js
3:17:10 PM: > node-sass@4.14.1 postinstall /opt/build/repo/web/node_modules/node-sass
3:17:10 PM: > node scripts/build.js
3:17:10 PM: Binary found at /opt/build/repo/web/node_modules/node-sass/vendor/linux-x64-67/binding.node
3:17:10 PM: Testing binary
3:17:10 PM: Binary is fine
3:17:13 PM: npm notice created a lockfile as package-lock.json. You should commit this file.
3:17:13 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents):
3:17:13 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3:17:13 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
3:17:13 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3:17:13 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
3:17:13 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3:17:13 PM: npm WARN grommet@2.16.3 requires a peer of styled-components@>= 5.1 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN grommet-icons@4.5.0 requires a peer of styled-components@>= 5.x but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN react-tooltip@3.11.6 requires a peer of react@>=^16.0.0 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN react-tooltip@3.11.6 requires a peer of react-dom@>=^16.0.0 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN ky-universal@0.5.0 requires a peer of web-streams-polyfill@>=2.0.0 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN @pmmmwh/react-refresh-webpack-plugin@0.4.3 requires a peer of @types/webpack@4.x but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN @pmmmwh/react-refresh-webpack-plugin@0.4.3 requires a peer of sockjs-client@^1.4.0 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN @pmmmwh/react-refresh-webpack-plugin@0.4.3 requires a peer of type-fest@^0.13.1 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN @pmmmwh/react-refresh-webpack-plugin@0.4.3 requires a peer of webpack-plugin-serve@0.x || 1.x but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN babel-preset-gatsby@0.12.2 requires a peer of core-js@^3.0.0 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN ws@7.4.3 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: npm WARN ws@7.4.3 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
3:17:13 PM: added 2905 packages from 1750 contributors and audited 2931 packages in 105.905s
3:17:13 PM: found 19 vulnerabilities (15 low, 4 high)
3:17:13 PM:   run `npm audit fix` to fix them, or `npm audit` for details
3:17:13 PM: NPM modules installed
3:17:13 PM: Started restoring cached go cache
3:17:13 PM: Finished restoring cached go cache
3:17:13 PM: Installing Go version 1.12
3:17:19 PM: unset GOOS;
3:17:19 PM: unset GOARCH;
3:17:19 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
3:17:19 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
3:17:19 PM: go version >&2;
3:17:19 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
3:17:19 PM: go version go1.12 linux/amd64
3:17:19 PM: Installing missing commands
3:17:19 PM: Verify run directory
3:17:21 PM: ​
3:17:21 PM: ────────────────────────────────────────────────────────────────
3:17:21 PM:   Netlify Build                                                 
3:17:21 PM: ────────────────────────────────────────────────────────────────
3:17:21 PM: ​
3:17:21 PM: ❯ Version
3:17:21 PM:   @netlify/build 9.8.3
3:17:21 PM: ​
3:17:21 PM: ❯ Flags
3:17:21 PM:   deployId: 60438e6e72eb410007782157
3:17:21 PM:   mode: buildbot
3:17:21 PM: ​
3:17:21 PM: ❯ Current directory
3:17:21 PM:   /opt/build/repo/web
3:17:21 PM: ​
3:17:21 PM: ❯ Config file
3:17:21 PM:   No config file was defined: using default values.
3:17:21 PM: ​
3:17:21 PM: ❯ Context
3:17:21 PM:   production
3:17:21 PM: ​
3:17:21 PM: ────────────────────────────────────────────────────────────────
3:17:21 PM:   1. Build command from Netlify app                             
3:17:21 PM: ────────────────────────────────────────────────────────────────
3:17:21 PM: ​
3:17:21 PM: $ npm run build
3:17:21 PM: > ripatrip-gatsby-site@0.1.0 build /opt/build/repo/web
3:17:21 PM: > gatsby build
3:17:25 PM: error gatsby build
3:17:25 PM: Build a Gatsby project.
3:17:25 PM: Options:
3:17:25 PM:   --verbose                   Turn on verbose output  [boolean] [default: false]
3:17:25 PM:   --no-color, --no-colors     Turn off the color in output  [boolean] [default: false]
3:17:25 PM:   --json                      Turn on the JSON logger  [boolean] [default: false]
3:17:25 PM:   --prefix-paths              Build site with link paths prefixed with the pathPrefix value in gatsby-config.js. Default is env.PREFIX_PATHS or false.  [boolean] [default: false]
3:17:25 PM:   --no-uglify                 Build site without uglifying JS bundles (for debugging).  [boolean] [default: false]
3:17:25 PM:   --profile                   Build site with react profiling (this can add some additional overhead). See https://reactjs.org/docs/profiler  [boolean] [default: false]
3:17:25 PM:   --graphql-tracing           Trace every graphql resolver, may have performance implications  [boolean] [default: false]
3:17:25 PM:   --open-tracing-config-file  Tracer configuration file (OpenTracing compatible). See https://gatsby.dev/tracing  [string]
3:17:25 PM:   -h, --help                  Show help  [boolean]
3:17:25 PM:   -v, --version               Show the version of the Gatsby CLI and the Gatsby package in the current project  [boolean]
3:17:25 PM: error There was a problem loading the local build command. Gatsby may not be installed. Perhaps you need to run "npm install"? globalThis is not defined
3:17:25 PM: 
3:17:25 PM: 
3:17:25 PM:   ReferenceError: globalThis is not defined
3:17:25 PM:   
3:17:25 PM:   - index.js:5 Object.<anonymous>
3:17:25 PM:     [web]/[queue-microtask]/index.js:5:25
3:17:25 PM:   
3:17:25 PM:   - v8-compile-cache.js:192 Module._compile
3:17:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:192:30
3:17:25 PM:   
3:17:25 PM:   - loader.js:827 Object.Module._extensions..js
3:17:25 PM:     internal/modules/cjs/loader.js:827:10
3:17:25 PM:   
3:17:25 PM:   - loader.js:685 Module.load
3:17:25 PM:     internal/modules/cjs/loader.js:685:32
3:17:25 PM:   
3:17:25 PM:   - loader.js:620 Function.Module._load
3:17:25 PM:     internal/modules/cjs/loader.js:620:12
3:17:25 PM:   
3:17:25 PM:   - loader.js:723 Module.require
3:17:25 PM:     internal/modules/cjs/loader.js:723:19
3:17:25 PM:   
3:17:25 PM:   - v8-compile-cache.js:159 require
3:17:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:159:20
3:17:25 PM:   
3:17:25 PM:   - index.js:4 Object.<anonymous>
3:17:25 PM:     [web]/[run-parallel]/index.js:4:24
3:17:25 PM:   
3:17:25 PM:   - v8-compile-cache.js:192 Module._compile
3:17:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:192:30
3:17:25 PM:   
3:17:25 PM:   - loader.js:827 Object.Module._extensions..js
3:17:25 PM:     internal/modules/cjs/loader.js:827:10
3:17:25 PM:   
3:17:25 PM:   - loader.js:685 Module.load
3:17:25 PM:     internal/modules/cjs/loader.js:685:32
3:17:25 PM:   
3:17:25 PM:   - loader.js:620 Function.Module._load
3:17:25 PM:     internal/modules/cjs/loader.js:620:12
3:17:25 PM:   
3:17:25 PM:   - loader.js:723 Module.require
3:17:25 PM:     internal/modules/cjs/loader.js:723:19
3:17:25 PM:   
3:17:25 PM:   - v8-compile-cache.js:159 require
3:17:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:159:20
3:17:25 PM:   
3:17:25 PM:   - async.js:5 Object.<anonymous>
3:17:25 PM:     [web]/[@nodelib]/fs.scandir/out/providers/async.js:5:13
3:17:25 PM:   
3:17:25 PM:   - v8-compile-cache.js:192 Module._compile
3:17:25 PM:     [web]/[v8-compile-cache]/v8-compile-cache.js:192:30
3:17:25 PM:   
3:17:25 PM: 
3:17:25 PM: npm ERR! code ELIFECYCLE
3:17:25 PM: npm ERR! errno 1
3:17:25 PM: npm ERR! ripatrip-gatsby-site@0.1.0 build: `gatsby build`
3:17:25 PM: npm ERR! Exit status 1
3:17:25 PM: npm ERR!
3:17:25 PM: npm ERR! Failed at the ripatrip-gatsby-site@0.1.0 build script.
3:17:25 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:17:25 PM: ​
3:17:25 PM: ────────────────────────────────────────────────────────────────
3:17:25 PM:   "build.command" failed                                        
3:17:25 PM: ────────────────────────────────────────────────────────────────
3:17:25 PM: ​
3:17:25 PM:   Error message
3:17:25 PM:   Command failed with exit code 1: npm run build
3:17:25 PM: ​
3:17:25 PM:   Error location
3:17:25 PM:   In Build command from Netlify app:
3:17:25 PM:   npm run build
3:17:25 PM: ​
3:17:25 PM:   Resolved config
3:17:25 PM:   build:
3:17:25 PM:     base: /opt/build/repo/web
3:17:25 PM:     command: npm run build
3:17:25 PM:     commandOrigin: ui
3:17:25 PM:     environment:
3:17:25 PM:       - NODE_VERSION
3:17:25 PM:     publish: /opt/build/repo/web/public
3:17:25 PM: Caching artifacts
3:17:25 PM: Started saving node modules
3:17:25 PM: Finished saving node modules
3:17:25 PM: Started saving build plugins
3:17:25 PM: Finished saving build plugins
3:17:25 PM: Started saving pip cache
3:17:25 PM: Finished saving pip cache
3:17:25 PM: Started saving emacs cask dependencies
3:17:25 PM: Finished saving emacs cask dependencies
3:17:25 PM: Started saving maven dependencies
3:17:25 PM: Finished saving maven dependencies
3:17:25 PM: Started saving boot dependencies
3:17:25 PM: Finished saving boot dependencies
3:17:25 PM: Started saving rust rustup cache
3:17:25 PM: Finished saving rust rustup cache
3:17:26 PM: Started saving go dependencies
3:17:27 PM: Finished saving go dependencies
3:17:31 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:17:31 PM: Failing build: Failed to build site
3:17:31 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
3:17:31 PM: Finished processing build request in 2m18.891968663s

Try adding gatsby as a dependency to your package.json.