Hello, I’m having issues deploying my next.js app and I’m receiving a 254 error. The complete error is pasted below. I’ve tried many suggestions that I’ve found here on the support forums but I’m still running into issues. Hoping someone can advise. Thanks so much!!
9:14:55 PM: build-image version: a2d22d22e4555d1ef0a972ed14a0a4b366ad20c4 (focal)
9:14:55 PM: build-image tag: v4.16.3
9:14:55 PM: buildbot version: 9a6b4d0d37eb2a90e2c482e1d6cfe9a0793e6262
9:14:55 PM: Building without cache
9:14:55 PM: Starting to prepare the repo for build
9:14:56 PM: No cached dependencies found. Cloning fresh repo
9:14:56 PM: git clone --filter=blob:none GitHub - justinharris23/portfolio2
9:15:03 PM: Preparing Git Reference refs/heads/main
9:15:04 PM: Parsing package.json dependencies
9:15:05 PM: Starting build script
9:15:05 PM: Installing dependencies
9:15:05 PM: Python version set to 2.7
9:15:05 PM: v16.19.0 is already installed.
9:15:06 PM: Now using node v16.19.0 (npm v8.19.3)
9:15:06 PM: Enabling Node.js Corepack
9:15:06 PM: Started restoring cached build plugins
9:15:06 PM: Finished restoring cached build plugins
9:15:06 PM: Attempting Ruby version 2.7.2, read from environment
9:15:06 PM: Using Ruby version 2.7.2
9:15:07 PM: Using PHP version 8.0
9:15:07 PM: Started restoring cached go cache
9:15:07 PM: Finished restoring cached go cache
9:15:07 PM: go version go1.19.4 linux/amd64
9:15:07 PM: Detected 0 framework(s)
9:15:07 PM: Installing missing commands
9:15:07 PM: Verify run directory
9:15:07 PM: Section completed: initializing
9:15:08 PM:
9:15:08 PM: Netlify Build
9:15:08 PM: ────────────────────────────────────────────────────────────────
9:15:08 PM:
9:15:08 PM: ❯ Version
9:15:08 PM: @netlify/build 29.4.1
9:15:08 PM:
9:15:08 PM: ❯ Flags
9:15:08 PM: baseRelDir: true
9:15:08 PM: buildId: 63bf6d1d9fec126e25449d81
9:15:08 PM: deployId: 63bf6d1d9fec126e25449d83
9:15:08 PM:
9:15:08 PM: ❯ Current directory
9:15:08 PM: /opt/build/repo
9:15:08 PM:
9:15:08 PM: ❯ Config file
9:15:08 PM: No config file was defined: using default values.
9:15:08 PM:
9:15:08 PM: ❯ Context
9:15:08 PM: production
9:15:08 PM:
9:15:08 PM: 1. Build command from Netlify app
9:15:08 PM: ────────────────────────────────────────────────────────────────
9:15:08 PM:
9:15:08 PM: $ npm run build
9:15:08 PM: npm ERR! code ENOENT
9:15:08 PM: npm ERR! syscall open
9:15:08 PM: npm ERR! path /opt/build/repo/package.json
9:15:08 PM: npm ERR! errno -2
9:15:08 PM: npm ERR! enoent ENOENT: no such file or directory, open ‘/opt/build/repo/package.json’
9:15:08 PM: npm ERR! enoent This is related to npm not being able to find a file.
9:15:08 PM: npm ERR! enoent
9:15:08 PM: npm ERR! A complete log of this run can be found in:
9:15:08 PM: npm ERR! /opt/buildhome/.npm/_logs/2023-01-12T02_15_08_875Z-debug-0.log
9:15:09 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)
9:15:08 PM:
9:15:08 PM: “build.command” failed
9:15:08 PM: ────────────────────────────────────────────────────────────────
9:15:08 PM:
9:15:08 PM: Error message
9:15:08 PM: Command failed with exit code 254: npm run build (Search results for '"non-zero exit code: 254"' - Netlify Support Forums)
9:15:08 PM:
9:15:08 PM: Error location
9:15:08 PM: In Build command from Netlify app:
9:15:08 PM: npm run build
9:15:08 PM:
9:15:08 PM: Resolved config
9:15:08 PM: build:
9:15:08 PM: command: npm run build
9:15:08 PM: commandOrigin: ui
9:15:08 PM: publish: /opt/build/repo
9:15:08 PM: publishOrigin: default
9:15:09 PM: Caching artifacts
9:15:09 PM: Started saving build plugins
9:15:09 PM: Finished saving build plugins
9:15:09 PM: Started saving pip cache
9:15:09 PM: Finished saving pip cache
9:15:09 PM: Started saving emacs cask dependencies
9:15:09 PM: Finished saving emacs cask dependencies
9:15:09 PM: Started saving maven dependencies
9:15:09 PM: Finished saving maven dependencies
9:15:09 PM: Started saving boot dependencies
9:15:09 PM: Finished saving boot dependencies
9:15:09 PM: Started saving rust rustup cache
9:15:09 PM: Finished saving rust rustup cache
9:15:09 PM: Started saving go dependencies
9:15:09 PM: Finished saving go dependencies
9:15:09 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:15:09 PM: Failing build: Failed to build site
9:15:10 PM: Finished processing build request in 14.321313117s