Gatsby build and develop both works error free locally but build fails on nelify

site: preeminent-zuccutto-83bdf0.netlify.app

2:35:50 AM: build-image version: a968751fa4fa5480005f9e300e07554d2cf87d06 (focal)
2:35:50 AM: buildbot version: 16b1763679bd714e032294dcf919120bca3a692a
2:35:50 AM: Fetching cached dependencies
2:35:50 AM: Failed to fetch cache, continuing with build
2:35:50 AM: Starting to prepare the repo for build
2:35:51 AM: No cached dependencies found. Cloning fresh repo
2:35:51 AM: git clone --filter=blob:none https://github.com/NobinPegasus/nobinpegasus.netlify
2:35:51 AM: Preparing Git Reference refs/heads/main
2:35:53 AM: Parsing package.json dependencies
2:35:55 AM: Starting to install dependencies
2:35:55 AM: Python version set to 3.8
2:35:55 AM: Attempting Ruby version 2.7.2, read from environment
2:35:55 AM: Using Ruby version 2.7.2
2:35:56 AM: Started restoring cached go cache
2:35:56 AM: Finished restoring cached go cache
2:35:56 AM: Installing Go version 1.19.5 (requested 1.19.5)
2:36:02 AM: go version go1.19.5 linux/amd64
2:36:02 AM: Using PHP version 8.0
2:36:03 AM: Attempting Node.js version 'v14.17.4' from .nvmrc
2:36:03 AM: Downloading and installing node v14.17.4...
2:36:03 AM: Downloading https://nodejs.org/dist/v14.17.4/node-v14.17.4-linux-x64.tar.xz...
2:36:04 AM: Computing checksum with sha256sum
2:36:04 AM: Checksums matched!
2:36:05 AM: Now using node v14.17.4 (npm v6.14.14)
2:36:06 AM: Started restoring cached build plugins
2:36:06 AM: Finished restoring cached build plugins
2:36:06 AM: Started restoring cached corepack dependencies
2:36:06 AM: Finished restoring cached corepack dependencies
2:36:06 AM: No npm workspaces detected
2:36:06 AM: Started restoring cached node modules
2:36:06 AM: Finished restoring cached node modules
2:36:06 AM: Installing npm packages using npm version 6.14.14
2:36:06 AM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@3. I'll try to do my best with it!
npm WARN deprecated @types/moment@2.13.0: This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed!
2:36:06 AM: npm WARN deprecated @types/markdown-to-jsx@7.0.1: This is a stub types definition. markdown-to-jsx provides its own type definitions, so you do not need this installed.
2:36:07 AM: npm WARN deprecated @types/yaml@1.9.7: This is a stub types definition. yaml provides its own type definitions, so you do not need this installed.
2:36:12 AM: npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
2:36:15 AM: npm WARN deprecated express-graphql@0.12.0: This package is no longer maintained. We recommend using `graphql-http` instead. Please consult the migration document https://github.com/graphql/graphql-http#migrating-express-grpahql.
2:36:16 AM: npm WARN deprecated string-similarity@1.2.2: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2:36:16 AM: npm WARN deprecated dommatrix@1.0.3: dommatrix is no longer maintained. Please use @thednp/dommatrix.
2:36:18 AM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
2:36:18 AM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
2:36:18 AM: 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.
2:36:19 AM: npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
2:36:19 AM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
2:36:20 AM: npm WARN deprecated trim@0.0.1: Use String.prototype.trim() instead
2:36:26 AM: npm WARN deprecated async-cache@1.1.0: No longer maintained. Use [lru-cache](http://npm.im/lru-cache) version 7.6 or higher, and provide an asynchronous `fetchMethod` option.
2:36:27 AM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
2:36:30 AM: npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
2:36:30 AM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
2:36:31 AM: npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
2:36:33 AM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
2:36:33 AM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
2:36:33 AM: 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
2:50:07 AM: > yarn@1.22.19 preinstall /opt/build/repo/node_modules/yarn
2:50:07 AM: > :; (node ./preinstall.js > /dev/null 2>&1 || true)
2:50:09 AM: > msgpackr-extract@3.0.2 install /opt/build/repo/node_modules/msgpackr-extract
2:50:09 AM: > node-gyp-build-optional-packages
2:50:09 AM: > @parcel/watcher@2.1.0 install /opt/build/repo/node_modules/@parcel/watcher
2:50:09 AM: > node-gyp-build
2:50:09 AM: > lmdb@2.5.2 install /opt/build/repo/node_modules/@parcel/cache/node_modules/lmdb
2:50:09 AM: > node-gyp-build-optional-packages
2:50:09 AM: > lmdb@2.5.3 install /opt/build/repo/node_modules/lmdb
2:50:09 AM: > node-gyp-build-optional-packages
2:50:10 AM: > sharp@0.30.7 install /opt/build/repo/node_modules/sharp
2:50:10 AM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
2:50:11 AM: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-linux-x64.tar.br
2:50:11 AM: sharp: Integrity check passed for linux-x64
2:50:12 AM: > canvas@2.11.2 install /opt/build/repo/node_modules/canvas
2:50:12 AM: > node-pre-gyp install --fallback-to-build --update-binary
2:50:13 AM: [canvas] Success: "/opt/build/repo/node_modules/canvas/build/Release/canvas.node" is installed via remote
2:50:13 AM: > @fortawesome/fontawesome-common-types@6.4.0 postinstall /opt/build/repo/node_modules/@fortawesome/fontawesome-common-types
2:50:13 AM: > node attribution.js
2:50:13 AM: Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
2:50:13 AM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
2:50:13 AM: Copyright 2023 Fonticons, Inc.
2:50:13 AM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
2:50:13 AM: > node -e "try{require('./postinstall')}catch(e){}"
2:50:14 AM: > core-js@3.30.1 postinstall /opt/build/repo/node_modules/core-js
2:50:14 AM: > node -e "try{require('./postinstall')}catch(e){}"
2:50:14 AM: > core-js-pure@3.30.1 postinstall /opt/build/repo/node_modules/core-js-pure
2:50:14 AM: > node -e "try{require('./postinstall')}catch(e){}"
2:50:14 AM: > es5-ext@0.10.62 postinstall /opt/build/repo/node_modules/es5-ext
2:50:14 AM: >  node -e "try{require('./_postinstall')}catch(e){}" || exit 0
2:50:14 AM: > gatsby-telemetry@3.25.0 postinstall /opt/build/repo/node_modules/gatsby-telemetry
2:50:14 AM: > node src/postinstall.js || true
2:50:14 AM: > gatsby-cli@4.25.0 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
2:50:14 AM: > node scripts/postinstall.js
2:50:14 AM: > @fortawesome/fontawesome-svg-core@6.4.0 postinstall /opt/build/repo/node_modules/@fortawesome/fontawesome-svg-core
2:50:14 AM: > node attribution.js
2:50:15 AM: Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
2:50:15 AM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
2:50:15 AM: Copyright 2023 Fonticons, Inc.
2:50:15 AM: > @fortawesome/free-brands-svg-icons@6.4.0 postinstall /opt/build/repo/node_modules/@fortawesome/free-brands-svg-icons
2:50:15 AM: > node attribution.js
2:50:15 AM: Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
2:50:15 AM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
2:50:15 AM: Copyright 2023 Fonticons, Inc.
2:50:15 AM: > @fortawesome/free-regular-svg-icons@6.4.0 postinstall /opt/build/repo/node_modules/@fortawesome/free-regular-svg-icons
2:50:15 AM: > node attribution.js
2:50:15 AM: Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
2:50:15 AM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
2:50:15 AM: Copyright 2023 Fonticons, Inc.
2:50:15 AM: > @fortawesome/free-solid-svg-icons@6.4.0 postinstall /opt/build/repo/node_modules/@fortawesome/free-solid-svg-icons
2:50:15 AM: > node attribution.js
2:50:15 AM: Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
2:50:15 AM: License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
2:50:15 AM: Copyright 2023 Fonticons, Inc.
2:50:15 AM: > gatsby@4.25.6 postinstall /opt/build/repo/node_modules/gatsby
2:50:15 AM: > node scripts/postinstall.js
2:50:15 AM: > postinstall-postinstall@2.1.0 postinstall /opt/build/repo/node_modules/postinstall-postinstall
2:50:15 AM: > node ./run.js
2:50:16 AM: > blog@1.0.0 postinstall /opt/build/repo
2:50:16 AM: > patch-package
2:50:16 AM: patch-package 6.5.1
2:50:16 AM: Applying patches...
2:50:16 AM: @merc/react-timeline@0.1.42 ✔
2:50:17 AM: npm WARN notsup Unsupported engine for gatsby-plugin-google-analytics@5.9.0: wanted: {"node":">=18.0.0"} (current: {"node":"14.17.4","npm":"6.14.14"})
2:50:17 AM: npm WARN notsup Not compatible with your version of node/npm: gatsby-plugin-google-analytics@5.9.0
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-darwin-x64@2.5.2 (node_modules/@parcel/cache/node_modules/lmdb/node_modules/@lmdb/lmdb-darwin-x64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-darwin-x64@2.5.2: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-darwin-arm64@2.5.2 (node_modules/@parcel/cache/node_modules/lmdb/node_modules/@lmdb/lmdb-darwin-arm64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-darwin-arm64@2.5.2: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-arm64@2.5.2 (node_modules/@parcel/cache/node_modules/lmdb/node_modules/@lmdb/lmdb-linux-arm64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-arm64@2.5.2: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-arm@2.5.2 (node_modules/@parcel/cache/node_modules/lmdb/node_modules/@lmdb/lmdb-linux-arm):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-arm@2.5.2: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-win32-x64@2.5.2 (node_modules/@parcel/cache/node_modules/lmdb/node_modules/@lmdb/lmdb-win32-x64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-win32-x64@2.5.2: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-darwin-x64@3.0.2 (node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-darwin-x64@3.0.2: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-linux-arm@3.0.2 (node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-linux-arm):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-linux-arm@3.0.2: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-linux-arm64@3.0.2 (node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-linux-arm64@3.0.2: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-win32-x64@3.0.2 (node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-win32-x64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-win32-x64@3.0.2: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2 (node_modules/msgpackr-extract/node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-darwin-arm64@2.5.3 (node_modules/lmdb/node_modules/@lmdb/lmdb-darwin-arm64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-darwin-arm64@2.5.3: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-darwin-x64@2.5.3 (node_modules/lmdb/node_modules/@lmdb/lmdb-darwin-x64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-darwin-x64@2.5.3: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-arm@2.5.3 (node_modules/lmdb/node_modules/@lmdb/lmdb-linux-arm):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-arm@2.5.3: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-arm64@2.5.3 (node_modules/lmdb/node_modules/@lmdb/lmdb-linux-arm64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-arm64@2.5.3: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-win32-x64@2.5.3 (node_modules/lmdb/node_modules/@lmdb/lmdb-win32-x64):
2:50:17 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-win32-x64@2.5.3: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:50:17 AM: npm WARN @react-pdf-viewer/core@3.12.0 requires a peer of pdfjs-dist@^2.16.105 || ^3.0.279 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN gatsby-plugin-google-analytics@5.9.0 requires a peer of gatsby@^5.0.0-next but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN gatsby-plugin-google-analytics@5.9.0 requires a peer of react@^18.0.0 || ^0.0.0 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN gatsby-plugin-google-analytics@5.9.0 requires a peer of react-dom@^18.0.0 || ^0.0.0 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.20.7 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN eslint-config-react-app@6.0.0 requires a peer of @typescript-eslint/eslint-plugin@^4.0.0 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN eslint-config-react-app@6.0.0 requires a peer of @typescript-eslint/parser@^4.0.0 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN eslint-config-react-app@6.0.0 requires a peer of babel-eslint@^10.0.0 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN eslint-config-react-app@6.0.0 requires a peer of eslint@^7.5.0 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN eslint-plugin-flowtype@5.10.0 requires a peer of eslint@^7.1.0 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825 requires a peer of react@0.0.0-experimental-c8b778b7f-20220825 but none is installed. You must install peer dependencies yourself.
2:50:17 AM: npm WARN blog@1.0.0 No repository field.
2:50:17 AM: npm WARN The package source-map is included as both a dev and production dependency.
2:50:17 AM: added 2509 packages from 1385 contributors and audited 2540 packages in 850.627s
2:50:17 AM: 434 packages are looking for funding
2:50:17 AM:   run `npm fund` for details
2:50:17 AM: found 11 vulnerabilities (4 moderate, 7 high)
2:50:17 AM:   run `npm audit fix` to fix them, or `npm audit` for details
2:50:17 AM: npm packages installed
2:50:17 AM: Install dependencies script success
2:50:17 AM: Starting build script
2:50:18 AM: Detected 1 framework(s)
2:50:18 AM: "gatsby" at version "4.25.6"
2:50:18 AM: Section completed: initializing
2:50:20 AM: ​
2:50:20 AM:   Netlify Build                                                 
2:50:20 AM: ────────────────────────────────────────────────────────────────
2:50:20 AM: ​
2:50:20 AM: ❯ Version
2:50:20 AM:   @netlify/build 29.10.1
2:50:20 AM: ​
2:50:20 AM: ❯ Flags
2:50:20 AM:   baseRelDir: true
2:50:20 AM:   buildId: 6452c5a25d2c620008a65de1
2:50:20 AM:   deployId: 6452c5a25d2c620008a65de3
2:50:20 AM: ​
2:50:20 AM: ❯ Current directory
2:50:20 AM:   /opt/build/repo
2:50:20 AM: ​
2:50:20 AM: ❯ Config file
2:50:20 AM:   /opt/build/repo/netlify.toml
2:50:20 AM: ​
2:50:20 AM: ❯ Context
2:50:20 AM:   production
2:50:20 AM: ​
2:50:20 AM: ❯ Installing plugins
2:50:20 AM:    - @netlify/plugin-gatsby@3.6.2
2:50:20 AM:    - netlify-plugin-gatsby-cache@0.3.0
2:50:33 AM: ​
2:50:33 AM: ❯ Loading plugins
2:50:33 AM:    - @netlify/plugin-gatsby@3.6.2 from Netlify app
2:50:33 AM:    - netlify-plugin-gatsby-cache@0.3.0 from netlify.toml
2:50:34 AM: ​
2:50:34 AM:   1. @netlify/plugin-gatsby (onPreBuild event)                  
2:50:34 AM: ────────────────────────────────────────────────────────────────
2:50:34 AM: ​
2:50:34 AM: No Gatsby cache found. Building fresh.
2:50:36 AM: The plugin 'netlify-plugin-gatsby-cache' is no longer required and should be removed.
2:50:36 AM: ​
2:50:36 AM: (@netlify/plugin-gatsby onPreBuild completed in 1.7s)
2:50:36 AM: ​
2:50:36 AM:   2. netlify-plugin-gatsby-cache (onPreBuild event)             
2:50:36 AM: ────────────────────────────────────────────────────────────────
2:50:36 AM: ​
2:50:36 AM: No Gatsby cache found. Building fresh.
2:50:36 AM: ​
2:50:36 AM: (netlify-plugin-gatsby-cache onPreBuild completed in 6ms)
2:50:36 AM: ​
2:50:36 AM:   3. Build command from Netlify app                             
2:50:36 AM: ────────────────────────────────────────────────────────────────
2:50:36 AM: ​
2:50:36 AM: $ gatsby build
2:50:39 AM: success compile gatsby files - 1.247s
2:50:41 AM: success load gatsby config - 1.998s
2:50:42 AM: success load plugins - 1.553s
2:50:42 AM: warning gatsby-plugin-react-helmet: Gatsby now has built-in support for modifying the document head. Learn more at https://gatsby.dev/gatsby-head
2:50:42 AM: success onPreInit - 0.004s
2:50:42 AM: success initialize cache - 0.048s
2:50:43 AM: success copy gatsby files - 0.095s
2:50:43 AM: success Compiling Gatsby Functions - 0.152s
2:50:43 AM: success onPreBootstrap - 0.161s
2:50:44 AM: success createSchemaCustomization - 0.081s
2:50:57 AM: success Checking for changed pages - 0.000s
2:50:57 AM: success source and transform nodes - 13.304s
2:50:58 AM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql
2:50:59 AM: success building schema - 2.099s
2:51:26 AM: warning Your GraphQL query in createPages took 26.618 seconds which is an unexpectedly long time. See https://gatsby.dev/create-pages-performance for tips on how to improve this.
2:51:26 AM: Writing search index.
2:51:26 AM: success createPages - 27.000s
2:51:28 AM: success createPagesStatefully - 1.715s
2:51:28 AM: info Total nodes: 192, SitePage nodes: 31 (use --verbose for breakdown)
2:51:28 AM: success Checking for changed pages - 0.000s
2:51:28 AM: success onPreExtractQueries - 0.000s
2:51:30 AM: error There was an error in your GraphQL query:
2:51:30 AM:       Field "banner" must not have a selection since type "String" has no subfields.
2:51:30 AM:       This can happen if you e.g. accidentally added { } to the field "banner". If you didn't expect "banner" to be of type "String" make sure that your input source and/or plugin is correct.
      However, if you expect "value" to exist, the field might be accessible in another subfield. Please try your query in GraphiQL.
2:51:30 AM:       It is recommended to explicitly type your GraphQL schema if you want to use optional fields.
2:51:30 AM: not finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 38.018s
2:51:30 AM: failed extract queries from components - 2.194s
2:51:30 AM: ​
2:51:30 AM:   "build.command" failed                                        
2:51:30 AM: ────────────────────────────────────────────────────────────────
2:51:30 AM: ​
2:51:30 AM:   Error message
2:51:30 AM:   Command failed with exit code 1: gatsby build (https://ntl.fyi/exit-code-1)
2:51:30 AM: ​
2:51:30 AM:   Error location
2:51:30 AM:   In Build command from Netlify app:
2:51:30 AM:   gatsby build
2:51:30 AM: ​
2:51:30 AM:   Resolved config
2:51:30 AM:   build:
2:51:30 AM:     command: gatsby build
2:51:30 AM:     commandOrigin: ui
2:51:30 AM:     environment:
2:51:30 AM:       - NODE_VERSION
2:51:30 AM:     publish: /opt/build/repo/public
2:51:30 AM:     publishOrigin: ui
2:51:30 AM:   headers:
2:51:31 AM:     - for: /*
      values:
        Access-Control-Allow-Origin: '*'
        Permissions-Policy: interest-cohort=()
  headersOrigin: config
  plugins:
    - inputs: {}
      origin: ui
      package: '@netlify/plugin-gatsby'
    - inputs: {}
      origin: config
      package: netlify-plugin-gatsby-cache
Caching artifacts
2:51:31 AM: Started saving node modules
2:51:31 AM: Finished saving node modules
2:51:31 AM: Started saving build plugins
2:51:31 AM: Finished saving build plugins
2:51:31 AM: Started saving corepack cache
2:51:31 AM: Finished saving corepack cache
2:51:31 AM: Started saving pip cache
2:51:31 AM: Finished saving pip cache
2:51:31 AM: Started saving emacs cask dependencies
2:51:31 AM: Finished saving emacs cask dependencies
2:51:31 AM: Started saving maven dependencies
2:51:31 AM: Finished saving maven dependencies
2:51:31 AM: Started saving boot dependencies
2:51:31 AM: Finished saving boot dependencies
2:51:31 AM: Started saving rust rustup cache
2:51:31 AM: Finished saving rust rustup cache
2:51:31 AM: Started saving go dependencies
2:51:31 AM: Finished saving go dependencies
2:51:34 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:51:34 AM: Failing build: Failed to build site
2:51:34 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
2:51:34 AM: Finished processing build request in 15m44.225s

My website shows success in both gatsby develop and gatsby build locally.
But on netlify it throws the above error.

The build configuration:

OS infos:

pegasus@pegasus:~$ uname -r
5.19.0-1007-nvidia-lowlatency
pegasus@pegasus:~$ uname -a
Linux pegasus 5.19.0-1007-nvidia-lowlatency #7-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 25 00:08:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

The nelify.toml

[[plugins]]
  package = "netlify-plugin-gatsby-cache"

[build.environment]
  NODE_VERSION = "18.16.0"

[[headers]]
  for = "/*"
  [headers.values]
    Permissions-Policy = "interest-cohort=()"
    Access-Control-Allow-Origin = "*"

Post.tsx

import React from 'react'
import Helmet from 'react-helmet'
import { graphql } from 'gatsby'
import styled from 'styled-components'
import { MDXRenderer } from 'gatsby-plugin-mdx'
import {
  Wrapper,
  Header,
  SEO,
  PrevNext,
  SectionTitle,
  SectionSubTitle,
  Narrow,
  Wide
} from 'components'
import { Layout } from 'layouts'
import { Content } from 'layouts/components'
import config from 'config/siteConfig'
import 'utils/prismjs-theme.css'
import Post from 'models/Post'
import { MDXProvider } from '@mdx-js/react'
import { ReactResponsiveEmbed } from 'components/ReactResponsiveEmbed'
import {
  YouTube,
  Video,
  SpeakerDeck,
  SoundCloud,
  Spotify,
  Toot,
  Tweet
} from 'components/Embeds'
import { theme } from 'config/theme'
import PageContext from 'models/PageContext'

const ShortCodes = {
  Narrow,
  Wide,
  ReactResponsiveEmbed,
  YouTube,
  Video,
  SpeakerDeck,
  Tweet,
  SoundCloud,
  Spotify,
  Toot
}

const PostContent = styled.div`
  margin-top: 1rem;
`

const TypoLink = styled.a`
  color: ${theme.colors.grey.default};
  margin: 0.5rem auto;
  display: block;
  font-size: 0.75rem;
  font-style: italic;
  &:hover {
    color: ${theme.colors.primary};
    text-decoration: underline;
  }
`

interface Props {
  data: {
    mdx: Post
  }
  pageContext: PageContext
}

const PostPage = (props: Props) => {
  const { prev, next } = props.pageContext
  const post = props.data.mdx
  return (
    <Layout>
      {post ? (
        <>
          <SEO path={post.fields.path} data={post} />
          <Helmet title={`${post.frontmatter.title} | ${config.siteTitle}`} />
          <Header
            banner={
              post.frontmatter.banner && post.frontmatter.banner.publicURL
            }
            bannerAttribution={post.frontmatter.bannerAttribution}
            left
          >
            <SectionTitle left>
              {post.frontmatter.title}
              <Line />
              <SectionSubTitle left>
                <Date dateTime={post.frontmatter.standardDate}>
                  {post.frontmatter.date}
                </Date>
              </SectionSubTitle>
            </SectionTitle>
          </Header>
          <Wrapper>
            <Content>
              <PostContent>
                <MDXProvider components={ShortCodes}>
                  <MDXRenderer>{post.body}</MDXRenderer>
                </MDXProvider>
              </PostContent>
              <hr style={{ margin: '0' }} />
              <TypoLink href={post.fields.githubLink}>
                Please submit typo corrections on GitHub
              </TypoLink>
              <PrevNext prev={prev} next={next} />
            </Content>
          </Wrapper>
        </>
      ) : null}
    </Layout>
  )
}
// Gatsby needs this default export to work.
// eslint-disable-next-line import/no-default-export
export default PostPage

const Line = styled.hr`
  color: white;
  width: 5rem;
  margin: 0.5rem 0;
  height: 3px;
`

const Date = styled.time`
  color: white;
  clear: both;
  font-family: ${config.headerFontFamily};
`

export const postQuery = graphql`
  query ($id: String!) {
    mdx(id: { eq: $id }) {
      id
      body
      fields {
        path
        githubLink
      }
      frontmatter {
        title
        date(formatString: "MMMM D, YYYY")
        standardDate: date(formatString: "YYYY-MM-DD")
        banner {
          publicURL
        }
        bannerAttribution
        socialImage {
          publicURL
        }
      }
      excerpt(pruneLength: 320)
      timeToRead
    }
  }
`

Frontmatter.ts

interface Frontmatter {
  date: string
  formattedDate?: string
  standardDate?: string
  title: string
  banner?: {
    publicURL: string
  }
  bannerAttribution?: string
  socialImage?: {
    publicURL: string
  }
}

export default Frontmatter

Hi @NobinPegasus,

Thanks for reaching out! Sorry to see you’re running into issues with your deploy.

I’m seeing this error in the deploy log:

10:06:28 AM: bash: gatsby: command not found

If you change the Build command here:

to npm run build

Is the build successful then?