Command failed with exit code 9: npm run build

I used to be able to deploy this with no issues (4/5 months ago) and now I get an error of Command failed with exit code 9: npm run build. I really have to tried to search on this site as well as Google and haven’t found anyone else talking about code 9.

Any advice or thoughts on how to resolve this is greatly appreciated!

4:03:51 PM: build-image version: a2d22d22e4555d1ef0a972ed14a0a4b366ad20c4 (focal)
4:03:51 PM: build-image tag: v4.16.3
4:03:51 PM: buildbot version: 4033cea21a3d9a6b51a0c8660e8b7502a7f7abfe
4:03:51 PM: Fetching cached dependencies
4:03:51 PM: Failed to fetch cache, continuing with build
4:03:51 PM: Starting to prepare the repo for build
4:03:51 PM: No cached dependencies found. Cloning fresh repo
4:03:51 PM: git clone --filter=blob:none https://github.com/musicjoeyoung/78ArmyBand
4:03:56 PM: Preparing Git Reference refs/heads/main
4:03:57 PM: Parsing package.json dependencies
4:03:59 PM: Starting build script
4:03:59 PM: Installing dependencies
4:03:59 PM: Python version set to 2.7
4:03:59 PM: v16.19.0 is already installed.
4:04:00 PM: Now using node v16.19.0 (npm v8.19.3)
4:04:00 PM: Enabling Node.js Corepack
4:04:00 PM: Started restoring cached build plugins
4:04:00 PM: Finished restoring cached build plugins
4:04:00 PM: Attempting Ruby version 2.7.2, read from environment
4:04:01 PM: Using Ruby version 2.7.2
4:04:01 PM: Using PHP version 8.0
4:04:01 PM: Started restoring cached corepack dependencies
4:04:01 PM: mv: cannot move '/opt/build/cache/.node/corepack' to '/opt/buildhome/.node/corepack': No such file or directory
4:04:01 PM: Finished restoring cached corepack dependencies
4:04:01 PM: No npm workspaces detected
4:04:01 PM: Started restoring cached node modules
4:04:01 PM: Finished restoring cached node modules
4:04:01 PM: Bypassing sha validation. Running pre & post install scripts
4:04:01 PM: Installing npm packages using npm version 8.19.3
4:04:03 PM: npm WARN ERESOLVE overriding peer dependency
4:04:03 PM: npm WARN While resolving: react-reconciler@0.23.0
4:04:03 PM: npm WARN Found: react@17.0.2
4:04:03 PM: npm WARN node_modules/react
4:04:03 PM: npm WARN   react@"^17.0.2" from the root project
4:04:03 PM: npm WARN   15 more (@emotion/react, @emotion/styled, ...)
4:04:03 PM: npm WARN
4:04:03 PM: npm WARN Could not resolve dependency:
4:04:03 PM: npm WARN peer react@"^16.0.0" from react-reconciler@0.23.0
4:04:03 PM: npm WARN node_modules/@react-pdf/renderer/node_modules/react-reconciler
4:04:03 PM: npm WARN   react-reconciler@"^0.23.0" from @react-pdf/renderer@2.3.0
4:04:03 PM: npm WARN   node_modules/@react-pdf/renderer
4:04:03 PM: npm WARN
4:04:03 PM: npm WARN Conflicting peer dependency: react@16.14.0
4:04:03 PM: npm WARN node_modules/react
4:04:03 PM: npm WARN   peer react@"^16.0.0" from react-reconciler@0.23.0
4:04:03 PM: npm WARN   node_modules/@react-pdf/renderer/node_modules/react-reconciler
4:04:03 PM: npm WARN     react-reconciler@"^0.23.0" from @react-pdf/renderer@2.3.0
4:04:03 PM: npm WARN     node_modules/@react-pdf/renderer
4:04:03 PM: npm WARN EBADENGINE Unsupported engine {
4:04:03 PM: npm WARN EBADENGINE   package: '78armyband@0.1.0',
4:04:03 PM: npm WARN EBADENGINE   required: { node: '16.3.0' },
4:04:03 PM: npm WARN EBADENGINE   current: { node: 'v16.19.0', npm: '8.19.3' }
4:04:03 PM: npm WARN EBADENGINE }
4:04:08 PM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
4:04:09 PM: npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
4:04:09 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
4:04:09 PM: npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.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).
4:04:10 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
4:04:10 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
4:04:10 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.
4:04:10 PM: npm WARN deprecated sane@2.5.2: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
4:04:10 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
4:04:11 PM: npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
4:04:11 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).
4:04:12 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
4:04:12 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).
4:04:12 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
4:04:12 PM: npm WARN deprecated html-webpack-plugin@4.0.0-alpha.2: please switch to a stable version
4:04:12 PM: npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
4:04:12 PM: npm WARN deprecated eslint-loader@2.1.1: This loader has been deprecated. Please use eslint-webpack-plugin
4:04:12 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).
4:04:13 PM: npm WARN deprecated emailjs-com@2.6.4: The SDK name changed to @emailjs/browser
4:04:13 PM: npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
4:04:13 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
4:04:13 PM: npm WARN deprecated babel-eslint@9.0.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
4:04:17 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 urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
4:04:17 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
4:04:19 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.
4:04:19 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.
4:04:24 PM: added 2214 packages, and audited 2215 packages in 22s
4:04:24 PM: 116 packages are looking for funding
4:04:24 PM:   run `npm fund` for details
4:04:24 PM: 75 vulnerabilities (12 low, 16 moderate, 42 high, 5 critical)
4:04:24 PM: To address issues that do not require attention, run:
4:04:24 PM:   npm audit fix
4:04:24 PM: To address all issues (including breaking changes), run:
4:04:24 PM:   npm audit fix --force
4:04:24 PM: Run `npm audit` for details.
4:04:24 PM: npm packages installed
4:04:24 PM: Started restoring cached go cache
4:04:24 PM: Finished restoring cached go cache
4:04:24 PM: Installing Go version 1.16.5 (requested 1.16.5)
4:04:28 PM: unset GOOS;
4:04:28 PM: unset GOARCH;
4:04:28 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.16.5.linux.amd64';
4:04:28 PM: export PATH="/opt/buildhome/.gimme/versions/go1.16.5.linux.amd64/bin:${PATH}";
4:04:28 PM: go version >&2;
4:04:28 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.16.5.linux.amd64.env"
4:04:28 PM: go version go1.16.5 linux/amd64
4:04:29 PM: Detected 1 framework(s)
4:04:29 PM: "create-react-app" at version "2.1.8"
4:04:29 PM: Installing missing commands
4:04:29 PM: Verify run directory
4:04:29 PM: Section completed: initializing
4:04:30 PM: ​
4:04:30 PM:   Netlify Build                                                 
4:04:30 PM: ────────────────────────────────────────────────────────────────
4:04:30 PM: ​
4:04:30 PM: ❯ Version
4:04:30 PM:   @netlify/build 29.4.5
4:04:31 PM: ​
4:04:31 PM: ❯ Flags
4:04:31 PM:   baseRelDir: true
4:04:31 PM:   buildId: 63c1c7357fbf980008c8c5ff
4:04:31 PM:   deployId: 63c1c7357fbf980008c8c601
4:04:31 PM: ​
4:04:31 PM: ❯ Current directory
4:04:31 PM:   /opt/build/repo
4:04:31 PM: ​
4:04:31 PM: ❯ Config file
4:04:31 PM:   No config file was defined: using default values.
4:04:31 PM: ​
4:04:31 PM: ❯ Context
4:04:31 PM:   production
4:04:31 PM: ​
4:04:31 PM:   1. Build command from Netlify app                             
4:04:31 PM: ────────────────────────────────────────────────────────────────
4:04:31 PM: ​
4:04:31 PM: $ npm run build
4:04:31 PM: > 78armyband@0.1.0 build
4:04:31 PM: > export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build
4:04:31 PM: node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
4:04:31 PM: ​
4:04:31 PM:   "build.command" failed                                        
4:04:31 PM: ────────────────────────────────────────────────────────────────
4:04:31 PM: ​
4:04:31 PM:   Error message
4:04:31 PM:   Command failed with exit code 9: npm run build (https://ntl.fyi/exit-code-9)
4:04:31 PM: ​
4:04:31 PM:   Error location
4:04:31 PM:   In Build command from Netlify app:
4:04:31 PM:   npm run build
4:04:31 PM: ​
4:04:32 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
4:04:31 PM:   Resolved config
4:04:31 PM:   build:
4:04:31 PM:     command: npm run build
4:04:31 PM:     commandOrigin: ui
4:04:31 PM:     publish: /opt/build/repo/build
4:04:31 PM:     publishOrigin: ui
4:04:31 PM: Caching artifacts
4:04:31 PM: Started saving node modules
4:04:31 PM: Finished saving node modules
4:04:31 PM: Started saving build plugins
4:04:31 PM: Finished saving build plugins
4:04:31 PM: Started saving pip cache
4:04:31 PM: Finished saving pip cache
4:04:31 PM: Started saving emacs cask dependencies
4:04:31 PM: Finished saving emacs cask dependencies
4:04:31 PM: Started saving maven dependencies
4:04:31 PM: Finished saving maven dependencies
4:04:31 PM: Started saving boot dependencies
4:04:31 PM: Finished saving boot dependencies
4:04:31 PM: Started saving rust rustup cache
4:04:31 PM: Finished saving rust rustup cache
4:04:31 PM: Started saving go dependencies
4:04:31 PM: Finished saving go dependencies
4:04:32 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:04:32 PM: Failing build: Failed to build site
4:04:32 PM: Finished processing build request in 41.389307019s

While I still haven’t found any explanation on what exit code 9 is, I did solve my problem. I changed the build command in the Netlify deploy settings from npm run build to react-scripts build. That got rid of any errors and successfully deployed the site!