First time using Netlify, I created an app with npx create-next-app@latest and uploaded to DevOps, AFAIK everything is done correctly.
3:08:55 PM: Build ready to start
3:08:58 PM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
3:08:58 PM: build-image tag: v4.10.1
3:08:58 PM: buildbot version: 37262c48b1f3cfa88c6caed707d29b19aef6a5a7
3:08:58 PM: Fetching cached dependencies
3:08:58 PM: Failed to fetch cache, continuing with build
3:08:58 PM: Starting to prepare the repo for build
3:08:58 PM: No cached dependencies found. Cloning fresh repo
3:08:58 PM: git clone Azure DevOps Services | Sign In
3:09:00 PM: Preparing Git Reference refs/heads/main
3:09:01 PM: Parsing package.json dependencies
3:09:01 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: βoutβ versus ββ in the Netlify UI
3:09:01 PM: Different build command detected, going to use the one specified in the Netlify configuration file: βyarn buildβ versus ββ in the Netlify UI
3:09:01 PM: Starting build script
3:09:01 PM: Installing dependencies
3:09:01 PM: Python version set to 2.7
3:09:02 PM: Downloading and installing node v16.17.0β¦
3:09:02 PM: Downloading https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xzβ¦
3:09:04 PM: Computing checksum with sha256sum
3:09:04 PM: Checksums matched!
3:09:06 PM: Now using node v16.17.0 (npm v8.15.0)
3:09:06 PM: Started restoring cached build plugins
3:09:06 PM: Finished restoring cached build plugins
3:09:06 PM: Attempting ruby version 2.7.2, read from environment
3:09:07 PM: Using ruby version 2.7.2
3:09:07 PM: Using PHP version 8.0
3:09:07 PM: Started restoring cached go cache
3:09:07 PM: Finished restoring cached go cache
3:09:07 PM: Installing Go version 1.17 (requested 1.17)
3:09:12 PM: unset GOOS;
3:09:12 PM: unset GOARCH;
3:09:12 PM: export GOROOT=β/opt/buildhome/.gimme/versions/go1.17.linux.amd64β;
3:09:12 PM: export PATH=β/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}β;
3:09:12 PM: go version >&2;
3:09:12 PM: export GIMME_ENV=β/opt/buildhome/.gimme/env/go1.17.linux.amd64.envβ
3:09:12 PM: go version go1.17 linux/amd64
3:09:12 PM: Installing missing commands
3:09:12 PM: Verify run directory
3:09:13 PM: β
3:09:13 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:13 PM: Netlify Build
3:09:13 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:13 PM: β
3:09:13 PM: β― Version
3:09:13 PM: @netlify/build 27.17.1
3:09:13 PM: β
3:09:13 PM: β― Flags
3:09:13 PM: baseRelDir: true
3:09:13 PM: buildId: 6318a5f70cab8f0aeff95212
3:09:13 PM: deployId: 6318a5f70cab8f0aeff95214
3:09:13 PM: β
3:09:13 PM: β― Current directory
3:09:13 PM: /opt/build/repo
3:09:13 PM: β
3:09:13 PM: β― Config file
3:09:13 PM: /opt/build/repo/netlify.toml
3:09:13 PM: β
3:09:13 PM: β― Context
3:09:13 PM: production
3:09:13 PM: β
3:09:13 PM: β― Installing plugins
3:09:13 PM: - @netlify/plugin-nextjs@4.21.1
3:09:13 PM: - netlify-plugin-cache-nextjs@1.4.0
3:09:25 PM: β
3:09:25 PM: β― Loading plugins
3:09:25 PM: - @netlify/plugin-nextjs@4.21.1 from netlify.toml
3:09:25 PM: - netlify-plugin-cache-nextjs@1.4.0 from netlify.toml
3:09:26 PM: β
3:09:26 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:26 PM: 1. @netlify/plugin-nextjs (onPreBuild event)
3:09:26 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:26 PM: β
3:09:26 PM: No Next.js cache to restore.
3:09:26 PM: Netlify configuration property βbuild.environment.NEXT_PRIVATE_TARGETβ value changed.
3:09:26 PM: β
3:09:26 PM: (@netlify/plugin-nextjs onPreBuild completed in 17ms)
3:09:26 PM: β
3:09:26 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:26 PM: 2. netlify-plugin-cache-nextjs (onPreBuild event)
3:09:26 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:26 PM: β
3:09:26 PM: No cache found for the .next folder at the location .next/cache
3:09:26 PM: β
3:09:26 PM: (netlify-plugin-cache-nextjs onPreBuild completed in 6ms)
3:09:26 PM: β
3:09:26 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:26 PM: 3. build.command from netlify.toml
3:09:26 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:26 PM: β
3:09:26 PM: $ yarn build
3:09:26 PM: yarn run v1.22.10
3:09:26 PM: error Couldnβt find a package.json file in "/opt/build/repo"info Visit yarn run | Yarn for documentation about this command.
3:09:26 PM: β
3:09:26 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:26 PM: βbuild.commandβ failed
3:09:26 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3:09:26 PM: β
3:09:26 PM: Error message
3:09:26 PM: Command failed with exit code 1: yarn build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
3:09:26 PM: β
3:09:26 PM: Error location
3:09:26 PM: In build.command from netlify.toml:
3:09:26 PM: yarn build
3:09:26 PM: β
3:09:26 PM: Resolved config
3:09:26 PM: build:
3:09:26 PM: command: yarn build
3:09:26 PM: commandOrigin: config
3:09:26 PM: environment:
3:09:26 PM: - NEXT_PRIVATE_TARGET
3:09:26 PM: publish: /opt/build/repo/out
3:09:26 PM: publishOrigin: config
3:09:26 PM: plugins:
3:09:26 PM: - inputs: {}
3:09:26 PM: origin: config
3:09:26 PM: package: β@netlify/plugin-nextjsβ
3:09:26 PM: - inputs: {}
3:09:26 PM: origin: config
3:09:26 PM: package: netlify-plugin-cache-nextjs
3:09:27 PM: Caching artifacts
3:09:28 PM: Creating deploy upload records
3:09:27 PM: Started saving build plugins
3:09:27 PM: Finished saving build plugins
3:09:27 PM: Started saving pip cache
3:09:27 PM: Finished saving pip cache
3:09:28 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)
3:09:27 PM: Started saving emacs cask dependencies
3:09:27 PM: Finished saving emacs cask dependencies
3:09:27 PM: Started saving maven dependencies
3:09:27 PM: Finished saving maven dependencies
3:09:27 PM: Started saving boot dependencies
3:09:27 PM: Finished saving boot dependencies
3:09:27 PM: Started saving rust rustup cache
3:09:27 PM: Finished saving rust rustup cache
3:09:27 PM: Started saving go dependencies
3:09:27 PM: Finished saving go dependencies
3:09:28 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:09:28 PM: Failing build: Failed to build site
3:09:28 PM: Finished processing build request in 30.741507101s