[Vitepress] Build failed due to a user error: Build script returned non-zero exit code: 2

Hi.
Please help.
My site : xsential
Build log
11:46:08 AM: build-image version: 3ffff9df3d5419545acc1b673a54de348174406d (focal)
11:46:08 AM: buildbot version: 4f566b97f4ce9e736614c3408381bda9711262c6
11:46:08 AM: Fetching cached dependencies
11:46:08 AM: Failed to fetch cache, continuing with build
11:46:08 AM: Starting to prepare the repo for build
11:46:08 AM: No cached dependencies found. Cloning fresh repo
11:46:08 AM: git clone --filter=blob:none https://github.com/ezzle/xsential
11:46:09 AM: Preparing Git Reference refs/heads/master
11:47:57 AM: Starting to install dependencies
11:47:57 AM: Python version set to 3.8
11:47:58 AM: Attempting Ruby version 2.7.2, read from environment
11:47:58 AM: Using Ruby version 2.7.2
11:47:59 AM: Started restoring cached go cache
11:47:59 AM: Finished restoring cached go cache
11:48:00 AM: go version go1.19.13 linux/amd64
11:48:00 AM: Using PHP version 8.0
11:48:01 AM: v18.18.2 is already installed.
11:48:01 AM: Now using node v18.18.2 (npm v9.8.1)
11:48:01 AM: Enabling Node.js Corepack
11:48:01 AM: Started restoring cached build plugins
11:48:01 AM: Finished restoring cached build plugins
11:48:01 AM: Started restoring cached corepack dependencies
11:48:01 AM: Finished restoring cached corepack dependencies
11:48:01 AM: No npm workspaces detected
11:48:01 AM: Started restoring cached node modules
11:48:01 AM: Finished restoring cached node modules
11:48:02 AM: Installing npm packages using npm version 9.8.1
11:48:05 AM: added 126 packages, and audited 127 packages in 4s
11:48:05 AM: 45 packages are looking for funding
11:48:05 AM: run npm fund for details
11:48:05 AM: found 0 vulnerabilities
11:48:05 AM: npm packages installed
11:48:06 AM: Successfully installed dependencies
11:48:06 AM: Starting build script
11:48:06 AM: Detected 0 framework(s)
11:48:06 AM: Section completed: initializing
11:48:08 AM: ​
11:48:08 AM: Netlify Build
11:48:08 AM: ────────────────────────────────────────────────────────────────
11:48:08 AM: ​
11:48:08 AM: ❯ Version
11:48:08 AM: @netlify/build 29.27.0
11:48:08 AM: ​
11:48:08 AM: ❯ Flags
11:48:08 AM: baseRelDir: true
11:48:08 AM: buildId: 6564736ee348be2d384d5489
11:48:08 AM: deployId: 6564736ee348be2d384d548b
11:48:08 AM: ​
11:48:08 AM: ❯ Current directory
11:48:08 AM: /opt/build/repo
11:48:08 AM: ​
11:48:08 AM: ❯ Config file
11:48:08 AM: No config file was defined: using default values.
11:48:08 AM: ​
11:48:08 AM: ❯ Context
11:48:08 AM: production
11:48:08 AM: ​
11:48:08 AM: Build command from Netlify app
11:48:08 AM: ────────────────────────────────────────────────────────────────
11:48:08 AM: ​
11:48:08 AM: $ npm run docs:build
11:48:08 AM: > docs:build
11:48:08 AM: > cross-env NODE_OPTIONS=–max-old-space-size=65536 vitepress build docs
11:48:09 AM: vitepress v1.0.0-rc.31
11:48:09 AM: - building client + server bundles…
12:02:53 PM: Failed during stage “building site”: Build script returned non-zero exit code: 2
12:02:53 PM: ​
12:02:53 PM: “build.command” failed
12:02:53 PM: ────────────────────────────────────────────────────────────────
12:02:53 PM: ​
12:02:53 PM: Error message
12:02:53 PM: Command failed with exit code 1: npm run docs:build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
12:02:53 PM: ​
12:02:53 PM: Error location
12:02:53 PM: In Build command from Netlify app:
12:02:53 PM: npm run docs:build
12:02:53 PM: ​
12:02:53 PM: Resolved config
12:02:53 PM: build:
12:02:53 PM: command: npm run docs:build
12:02:53 PM: commandOrigin: ui
12:02:53 PM: environment:
12:02:53 PM: - NODE_OPTIONS
12:02:53 PM: publish: /opt/build/repo/docs/.vitepress/dist
12:02:53 PM: publishOrigin: ui
12:02:53 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:02:53 PM: Failing build: Failed to build site
12:02:53 PM: Finished processing build request in 16m45.851s

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

Hi there,

Can you run through this support guide to troubleshoot the build and let us know if any of those solve the issue?