How to solve error on deploying?

Command failed with exit code 1: npm run build

8:03:27 PM: Netlify Build
8:03:27 PM: ────────────────────────────────────────────────────────────────
8:03:27 PM: ​
8:03:27 PM: ❯ Version
8:03:27 PM: @netlify/build 29.20.5
8:03:27 PM: ​
8:03:27 PM: ❯ Flags
8:03:27 PM: baseRelDir: true
8:03:27 PM: buildId: 64dd00af0388fc00089af2bf
8:03:27 PM: deployId: 64dd00af0388fc00089af2c1
8:03:27 PM: ​
8:03:27 PM: ❯ Current directory
8:03:27 PM: /opt/build/repo
8:03:27 PM: ​
8:03:27 PM: ❯ Config file
8:03:27 PM: No config file was defined: using default values.
8:03:27 PM: ​
8:03:27 PM: ❯ Context
8:03:27 PM: production
8:03:27 PM: ​
8:03:27 PM: Build command from Netlify app
8:03:27 PM: ────────────────────────────────────────────────────────────────
8:03:27 PM: ​
8:03:27 PM: $ npm run build
8:03:27 PM: > codebridge0.0.0 build
8:03:27 PM: > ng build
8:03:30 PM: Compiling angular/core : es2015 as esm2015
8:03:30 PM: Compiling angular/animations : es2015 as esm2015
8:03:31 PM: Compiling angular/compiler/testing : es2015 as esm2015
8:03:33 PM: Compiling angular/common : es2015 as esm2015
8:03:33 PM: Compiling angular/core/testing : es2015 as esm2015
8:03:33 PM: Compiling angular/animations/browser : es2015 as esm2015
8:03:34 PM: Compiling angular/animations/browser/testing : es2015 as esm2015
8:03:34 PM: Compiling angular/platform-browser : es2015 as esm2015
8:03:34 PM: Compiling angular/common/http : es2015 as esm2015
8:03:35 PM: Compiling angular/common/testing : es2015 as esm2015
8:03:35 PM: Compiling angular/router : es2015 as esm2015
8:03:35 PM: Compiling angular/forms : es2015 as esm2015
8:03:36 PM: Compiling angular/platform-browser-dynamic : es2015 as esm2015
8:03:36 PM: Compiling angular/platform-browser/animations : es2015 as esm2015
8:03:36 PM: Compiling angular/platform-browser/testing : es2015 as esm2015
8:03:38 PM: Compiling angular/common/http/testing : es2015 as esm2015
8:03:39 PM: Compiling angular/platform-browser-dynamic/testing : es2015 as esm2015
8:03:39 PM: Compiling angular/router/testing : es2015 as esm2015
8:03:43 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
8:03:41 PM: node:internal/crypto/hash:69
8:03:41 PM: this[kHandle] = new _Hash(algorithm, xofLen);
8:03:41 PM: ^
8:03:41 PM: Error: error:0308010C:digital envelope routines::unsupported
8:03:41 PM: at new Hash (node:internal/crypto/hash:69:19)
8:03:41 PM: at Object.createHash (node:crypto:133:10)
8:03:41 PM: at module.exports (/opt/build/repo/node_modules/webpack/lib/util/createHash.js:135:53)
8:03:41 PM: at NormalModule._initBuildHash (/opt/build/repo/node_modules/webpack/lib/NormalModule.js:417:16)
8:03:41 PM: at /opt/build/repo/node_modules/webpack/lib/NormalModule.js:452:10
8:03:41 PM: at /opt/build/repo/node_modules/webpack/lib/NormalModule.js:323:13
8:03:41 PM: at /opt/build/repo/node_modules/loader-runner/lib/LoaderRunner.js:367:11
8:03:41 PM: at /opt/build/repo/node_modules/loader-runner/lib/LoaderRunner.js:203:19
8:03:41 PM: at VirtualFileSystemDecorator.readFile (/opt/build/repo/node_modules/ngtools/webpack/src/virtual_file_system_decorator.js:46:13)
8:03:41 PM: at processResource (/opt/build/repo/node_modules/loader-runner/lib/LoaderRunner.js:202:11)
8:03:41 PM: at iteratePitchingLoaders (/opt/build/repo/node_modules/loader-runner/lib/LoaderRunner.js:158:10)
8:03:41 PM: at runLoaders (/opt/build/repo/node_modules/loader-runner/lib/LoaderRunner.js:365:2)
8:03:41 PM: at NormalModule.doBuild (/opt/build/repo/node_modules/webpack/lib/NormalModule.js:295:3)
8:03:41 PM: at NormalModule.build (/opt/build/repo/node_modules/webpack/lib/NormalModule.js:446:15)
8:03:41 PM: at Compilation.buildModule (/opt/build/repo/node_modules/webpack/lib/Compilation.js:739:10)
8:03:41 PM: at /opt/build/repo/node_modules/webpack/lib/Compilation.js:981:14 {
8:03:41 PM: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ],
8:03:41 PM: library: ‘digital envelope routines’,
8:03:41 PM: reason: ‘unsupported’,
8:03:41 PM: code: ‘ERR_OSSL_EVP_UNSUPPORTED’
8:03:41 PM: }
8:03:41 PM: Node.js v18.17.1
8:03:41 PM: ​
8:03:41 PM: build.command failed
8:03:41 PM: ────────────────────────────────────────────────────────────────
8:03:41 PM: ​
8:03:41 PM: Error message
8:03:41 PM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
8:03:41 PM: ​
8:03:41 PM: Error location
8:03:41 PM: In Build command from Netlify app:
8:03:41 PM: npm run build
8:03:41 PM: ​
8:03:41 PM: Resolved config
8:03:41 PM: build:
8:03:41 PM: command: npm run build
8:03:41 PM: commandOrigin: ui
8:03:41 PM: publish: /opt/build/repo/dist
8:03:41 PM: publishOrigin: ui
8:03:42 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:03:42 PM: Failing build: Failed to build site
8:03:43 PM: Finished processing build request in 55.517s**

This is a Webpack issue, not Netlify. Downgrade your Node version to 17 or less. Manage build dependencies | Netlify Docs