#1
failed during stage 'building site' build script returned non-zero exit code 2
This is the error i have i have searched almost everywhere but no solution found
3:24:10 PM: Netlify Build
3:24:10 PM: ────────────────────────────────────────────────────────────────
3:24:10 PM: ​
3:24:10 PM: ❯ Version
3:24:10 PM: @netlify/build 29.12.1
3:24:10 PM: ​
3:24:10 PM: ❯ Flags
3:24:10 PM: baseRelDir: true
3:24:10 PM: buildId: 64886de54f9e4e007d3fe056
3:24:10 PM: deployId: 64886de54f9e4e007d3fe058
3:24:10 PM: ​
3:24:10 PM: ❯ Current directory
3:24:10 PM: /opt/build/repo
3:24:10 PM: ​
3:24:10 PM: ❯ Config file
3:24:10 PM: No config file was defined: using default values.
3:24:10 PM: ​
3:24:10 PM: ❯ Context
3:24:10 PM: production
3:24:10 PM: ​
3:24:10 PM: ❯ Installing plugins
3:24:10 PM: - @netlify/plugin-nextjs@3.9.2
3:24:17 PM: ​
3:24:17 PM: ❯ Using Next.js Runtime - v3.9.2
3:24:17 PM: ​
3:24:17 PM: ❯ Outdated plugins
3:24:17 PM: - @netlify/plugin-nextjs@3.9.2: latest version is 4.37.4
3:24:17 PM: To upgrade this plugin, please uninstall and re-install it from the Netlify plugins directory (https://app.netlify.com/plugins)
3:24:18 PM: ​
3:24:18 PM: @netlify/plugin-nextjs (onPreBuild event)
3:24:18 PM: ────────────────────────────────────────────────────────────────
3:24:18 PM: ​
3:24:18 PM: Using Next.js 10.0.6
3:24:18 PM: The "target" config property must be one of "serverless", "experimental-serverless-trace". Building with "serverless" target.
3:24:18 PM: No Next.js cache to restore.
3:24:18 PM: ​
3:24:18 PM: (@netlify/plugin-nextjs onPreBuild completed in 24ms)
3:24:18 PM: ​
3:24:18 PM: Build command from Netlify app
3:24:18 PM: ────────────────────────────────────────────────────────────────
3:24:18 PM: ​
3:24:18 PM: $ npm run build
3:24:18 PM: > nextjs-course@0.1.0 build
3:24:18 PM: > next build
3:24:19 PM: node:internal/errors:490
3:24:19 PM: ErrorCaptureStackTrace(err);
3:24:19 PM: ^
3:24:19 PM: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in /opt/build/repo/node_modules/postcss/package.json
3:24:19 PM: at new NodeError (node:internal/errors:399:5)
3:24:19 PM: at exportsNotFound (node:internal/modules/esm/resolve:361:10)
3:24:19 PM: at packageExportsResolve (node:internal/modules/esm/resolve:697:9)
3:24:19 PM: at resolveExports (node:internal/modules/cjs/loader:565:36)
3:24:19 PM: at Module._findPath (node:internal/modules/cjs/loader:634:31)
3:24:19 PM: at Module._resolveFilename (node:internal/modules/cjs/loader:1061:27)
3:24:19 PM: at Module._load (node:internal/modules/cjs/loader:920:27)
3:24:19 PM: at Module.require (node:internal/modules/cjs/loader:1141:19)
3:24:19 PM: at require (node:internal/modules/cjs/helpers:110:18)
3:24:19 PM: at 552 (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11590)
3:24:19 PM: at __nccwpck_require__ (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
3:24:19 PM: at 270 (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:400)
3:24:19 PM: at __nccwpck_require__ (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
3:24:19 PM: at 327 (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:260)
3:24:19 PM: at __nccwpck_require__ (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:11735)
3:24:19 PM: at 845 (/opt/build/repo/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:3733) {
3:24:19 PM: code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
3:24:19 PM: }
3:24:19 PM: Node.js v18.16.0
3:24:19 PM: ​
3:24:19 PM: "build.command" failed
3:24:19 PM: ────────────────────────────────────────────────────────────────
3:24:19 PM: ​
3:24:19 PM: Error message
3:24:19 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
3:24:19 PM: ​
3:24:19 PM: Error location
3:24:19 PM: In Build command from Netlify app:
3:24:19 PM: npm run build
3:24:19 PM: ​
3:24:19 PM: Resolved config
3:24:19 PM: build:
3:24:19 PM: command: npm run build
3:24:19 PM: commandOrigin: ui
3:24:19 PM: publish: /opt/build/repo/.next
3:24:19 PM: publishOrigin: ui
3:24:19 PM: plugins:
3:24:19 PM: - inputs: {}
3:24:19 PM: origin: ui
3:24:19 PM: package: '@netlify/plugin-nextjs'
3:24:21 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
3:24:21 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:24:21 PM: Failing build: Failed to build site
3:24:21 PM: Finished processing build request in 30.134s