Build Fails Puppeteer Error

I’m getting a build error. It seems that the puppeteer package version is no longer supported.
Site name: tomtawadros.com
Build log:

12:10:13 PM: build-image version: ecdc8b770f4a0193fd3f258c1bc6029e681813a4 (focal)
12:10:13 PM: buildbot version: 244d5322c7eb13029c1d65f78393f886c2e07fdb
12:10:13 PM: Fetching cached dependencies
12:10:13 PM: Failed to fetch cache, continuing with build
12:10:13 PM: Starting to prepare the repo for build
12:10:14 PM: No cached dependencies found. Cloning fresh repo
12:10:14 PM: git clone --filter=blob:none https://github.com/Twads9816/Portfolio
12:10:14 PM: Preparing Git Reference refs/heads/main
12:10:18 PM: Starting to install dependencies
12:10:19 PM: Python version set to 3.8
12:10:19 PM: Attempting Ruby version 2.7.2, read from environment
12:10:20 PM: Using Ruby version 2.7.2
12:10:21 PM: Started restoring cached go cache
12:10:21 PM: Finished restoring cached go cache
12:10:22 PM: go version go1.19.13 linux/amd64
12:10:24 PM: Using PHP version 8.0
12:10:27 PM: Downloading and installing node v18.17.1...
12:10:27 PM: Downloading https://nodejs.org/dist/v18.17.1/node-v18.17.1-linux-x64.tar.xz...
12:10:27 PM: Computing checksum with sha256sum
12:10:27 PM: Checksums matched!
12:10:30 PM: Now using node v18.17.1 (npm v9.6.7)
12:10:30 PM: Enabling Node.js Corepack
12:10:30 PM: Started restoring cached build plugins
12:10:30 PM: Finished restoring cached build plugins
12:10:30 PM: Started restoring cached corepack dependencies
12:10:30 PM: Finished restoring cached corepack dependencies
12:10:30 PM: No npm workspaces detected
12:10:30 PM: Started restoring cached node modules
12:10:30 PM: Finished restoring cached node modules
12:10:31 PM: Installing npm packages using npm version 9.6.7
12:10:33 PM: npm WARN ERESOLVE overriding peer dependency
12:10:33 PM: npm WARN While resolving: react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
12:10:33 PM: npm WARN Found: react@18.2.0
12:10:33 PM: npm WARN node_modules/react
12:10:33 PM: npm WARN   react@"^18.2.0" from the root project
12:10:33 PM: npm WARN   12 more (@formspree/react, @gatsbyjs/reach-router, ...)
12:10:33 PM: npm WARN
12:10:33 PM: npm WARN Could not resolve dependency:
12:10:33 PM: npm WARN peer react@"0.0.0-experimental-c8b778b7f-20220825" from react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
12:10:33 PM: npm WARN node_modules/react-server-dom-webpack
12:10:33 PM: npm WARN   react-server-dom-webpack@"0.0.0-experimental-c8b778b7f-20220825" from gatsby@5.12.12
12:10:33 PM: npm WARN   node_modules/gatsby
12:10:33 PM: npm WARN
12:10:33 PM: npm WARN Conflicting peer dependency: react@0.0.0-experimental-c8b778b7f-20220825
12:10:33 PM: npm WARN node_modules/react
12:10:33 PM: npm WARN   peer react@"0.0.0-experimental-c8b778b7f-20220825" from react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
12:10:33 PM: npm WARN   node_modules/react-server-dom-webpack
12:10:33 PM: npm WARN     react-server-dom-webpack@"0.0.0-experimental-c8b778b7f-20220825" from gatsby@5.12.12
12:10:33 PM: npm WARN     node_modules/gatsby
12:10:38 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
12:10:39 PM: npm WARN deprecated string-similarity@1.2.2: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
12:10:39 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
12:10:39 PM: npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
12:10:39 PM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
12:10:40 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
12:10:40 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
12:10:40 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
12:10:42 PM: npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
12:10:44 PM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
12:10:45 PM: npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
12:10:46 PM: npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
12:10:46 PM: npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
12:10:46 PM: npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
12:10:46 PM: npm WARN deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
12:10:46 PM: npm WARN deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
12:10:47 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.
12:10:53 PM: npm WARN deprecated core-js@1.2.7: 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.
12:10:55 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.
12:10:55 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.
12:11:20 PM: added 1970 packages, and audited 2172 packages in 50s
12:11:20 PM: 341 packages are looking for funding
12:11:20 PM:   run `npm fund` for details
12:11:21 PM: 86 vulnerabilities (2 low, 27 moderate, 40 high, 17 critical)
12:11:21 PM: To address issues that do not require attention, run:
12:11:21 PM:   npm audit fix
12:11:21 PM: To address all issues possible (including breaking changes), run:
12:11:21 PM:   npm audit fix --force
12:11:21 PM: Some issues need review, and may require choosing
12:11:21 PM: a different dependency.
12:11:21 PM: Run `npm audit` for details.
12:11:21 PM: npm packages installed
12:11:22 PM: Successfully installed dependencies
12:11:22 PM: Starting build script
12:11:24 PM: Detected 1 framework(s)
12:11:24 PM: "gatsby" at version "5.12.12"
12:11:24 PM: Section completed: initializing
12:11:26 PM: ​
12:11:26 PM: Netlify Build                                                 
12:11:26 PM: ────────────────────────────────────────────────────────────────
12:11:26 PM: ​
12:11:26 PM: ❯ Version
12:11:26 PM:   @netlify/build 29.54.3
12:11:26 PM: ​
12:11:26 PM: ❯ Flags
12:11:26 PM:   accountId: 6425de59d95c9f03682b0d66
12:11:26 PM:   baseRelDir: true
12:11:26 PM:   buildId: 66f435d20711b41116a69509
12:11:26 PM:   deployId: 66f435d20711b41116a6950b
12:11:26 PM: ​
12:11:26 PM: ❯ Current directory
12:11:26 PM:   /opt/build/repo
12:11:26 PM: ​
12:11:26 PM: ❯ Config file
12:11:26 PM:   No config file was defined: using default values.
12:11:26 PM: ​
12:11:26 PM: ❯ Context
12:11:26 PM:   production
12:11:26 PM: ​
12:11:26 PM: ❯ Installing plugins
12:11:26 PM:    - @netlify/plugin-gatsby@3.8.1
12:11:26 PM:    - @netlify/plugin-lighthouse@6.0.0
12:11:42 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:11:42 PM: ​
12:11:42 PM: Dependencies installation error                               
12:11:42 PM: ────────────────────────────────────────────────────────────────
12:11:42 PM: ​
12:11:42 PM:   Error message
12:11:42 PM:   Error while installing dependencies in /opt/build/repo/.netlify/plugins/
12:11:42 PM:   npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
12:11:42 PM:   npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
12:11:42 PM:   npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
12:11:42 PM:   npm WARN deprecated intl-messageformat-parser@1.8.1: We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser
12:11:42 PM:   npm WARN deprecated puppeteer@18.2.1: < 22.8.2 is no longer supported
12:11:42 PM:   npm ERR! code 1
12:11:42 PM:   npm ERR! path /opt/build/repo/.netlify/plugins/node_modules/puppeteer
12:11:42 PM:   npm ERR! command failed
12:11:42 PM:   npm ERR! command sh -c node install.js
12:11:42 PM:   npm ERR! ERROR: Failed to set up Chromium r1045629! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
12:11:42 PM:   npm ERR! Error: read ECONNRESET
12:11:42 PM:   npm ERR!     at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
12:11:42 PM:   npm ERR!   errno: -104,
12:11:42 PM:   npm ERR!   code: 'ECONNRESET',
12:11:42 PM:   npm ERR!   syscall: 'read'
12:11:42 PM:   npm ERR! }
12:11:42 PM: ​​
12:11:42 PM:   Resolved config
12:11:42 PM:   build:
12:11:42 PM:     command: npm run build
12:11:42 PM:     commandOrigin: ui
12:11:42 PM:     environment:
12:11:42 PM:       - NODE_VERSION
12:11:42 PM:     publish: /opt/build/repo/public
12:11:42 PM:     publishOrigin: ui
12:11:42 PM:   plugins:
12:11:42 PM:     - inputs: {}
12:11:42 PM:       origin: ui
12:11:42 PM:       package: '@netlify/plugin-gatsby'
12:11:42 PM:     - inputs: {}
12:11:42 PM:       origin: ui
12:11:42 PM:       package: '@netlify/plugin-lighthouse'
12:11:42 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:11:42 PM: Failing build: Failed to build site
12:11:43 PM: Finished processing build request in 1m30.02s

The error log shows

npm WARN deprecated puppeteer@18.2.1: < 22.8.2 is no longer supported

However npm show puppeteer version shows I have version 23.4.1. The chat bot is telling me to just skip the installation with the PUPPETEER_SKIP_DOWNLOAD=true env variable. Should I just use the env variable or am I missing something.

Since posting this I’ve continued the build process on a different branch and can no longer reproduce this error. I didn’t explicitly change anything puppeteer related. I’ll post here if the issue pops up again.