Random Code 1 & 2 error

Hey,

I just re-built a website that built fine a few months ago again, but I am getting errors. I don’t see what could be wrong as nothing has changed in the code or settings on netlify.

Logs:

12:57:17 PM: Build ready to start
12:57:19 PM: build-image version: a49edbc55fc722f80f6b85963a5060f8d043a844 (focal)
12:57:19 PM: build-image tag: v4.8.1
12:57:19 PM: buildbot version: f89dd42aa70d76d1da992dc3fa004a4c745208bc
12:57:20 PM: Fetching cached dependencies
12:57:20 PM: Failed to fetch cache, continuing with build
12:57:20 PM: Starting to prepare the repo for build
12:57:20 PM: No cached dependencies found. Cloning fresh repo
12:57:20 PM: git clone https://github.com/PatelN123/modport
12:57:21 PM: Preparing Git Reference refs/heads/main
12:57:21 PM: Parsing package.json dependencies
12:57:22 PM: Starting build script
12:57:22 PM: Installing dependencies
12:57:22 PM: Python version set to 2.7
12:57:23 PM: Attempting node version ‘16’ from .node-version
12:57:23 PM: v16.15.1 is already installed.
12:57:23 PM: Now using node v16.15.1 (npm v8.11.0)
12:57:23 PM: Started restoring cached build plugins
12:57:23 PM: Finished restoring cached build plugins
12:57:23 PM: Attempting ruby version 2.7.2, read from environment
12:57:24 PM: Using ruby version 2.7.2
12:57:25 PM: Using PHP version 8.0
12:57:25 PM: No npm workspaces detected
12:57:25 PM: Started restoring cached node modules
12:57:25 PM: Finished restoring cached node modules
12:57:25 PM: Installing NPM modules using NPM version 8.11.0
12:57:26 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
12:57:26 PM: npm WARN config location in the cache, and they are managed by
12:57:26 PM: npm WARN config cacache.
12:57:26 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
12:57:26 PM: npm WARN config location in the cache, and they are managed by
12:57:26 PM: npm WARN config cacache.
12:57:26 PM: 8.11.0
12:57:26 PM: NPM modules installed
12:57:26 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
12:57:26 PM: npm WARN config location in the cache, and they are managed by
12:57:26 PM: npm WARN config cacache.
12:57:26 PM: Started restoring cached go cache
12:57:26 PM: Finished restoring cached go cache
12:57:26 PM: Installing Go version 1.16.5 (requested 1.16.5)
12:57:31 PM: unset GOOS;
12:57:31 PM: unset GOARCH;
12:57:31 PM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.16.5.linux.amd64’;
12:57:31 PM: export PATH=“/opt/buildhome/.gimme/versions/go1.16.5.linux.amd64/bin:${PATH}”;
12:57:31 PM: go version >&2;
12:57:31 PM: export GIMME_ENV=“/opt/buildhome/.gimme/env/go1.16.5.linux.amd64.env”
12:57:31 PM: go version go1.16.5 linux/amd64
12:57:31 PM: Installing missing commands
12:57:31 PM: Verify run directory
12:57:33 PM: ​
12:57:33 PM: ────────────────────────────────────────────────────────────────
12:57:33 PM: Netlify Build
12:57:33 PM: ────────────────────────────────────────────────────────────────
12:57:33 PM: ​
12:57:33 PM: ❯ Version
12:57:33 PM: @netlify/build 27.1.5
12:57:33 PM: ​
12:57:33 PM: ❯ Flags
12:57:33 PM: baseRelDir: true
12:57:33 PM: buildId: 62b1b21d474f2a0008d0d45b
12:57:33 PM: deployId: 62b1b21d474f2a0008d0d45d
12:57:33 PM: ​
12:57:33 PM: ❯ Current directory
12:57:33 PM: /opt/build/repo
12:57:33 PM: ​
12:57:33 PM: ❯ Config file
12:57:33 PM: /opt/build/repo/netlify.toml
12:57:33 PM: ​
12:57:33 PM: ❯ Context
12:57:33 PM: production
12:57:33 PM: ​
12:57:33 PM: ────────────────────────────────────────────────────────────────
12:57:33 PM: 1. build.command from netlify.toml
12:57:33 PM: ────────────────────────────────────────────────────────────────
12:57:33 PM: ​
12:57:33 PM: $ npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store && npx pnpm run generate
12:57:33 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
12:57:33 PM: npm WARN config location in the cache, and they are managed by
12:57:33 PM: npm WARN config cacache.
12:57:33 PM: npm WARN exec The following package was not found and will be installed: pnpm
12:57:35 PM: Lockfile is up-to-date, resolution step is skipped
12:57:35 PM: Progress: resolved 1, reused 0, downloaded 0, added 0
12:57:35 PM: Packages: +1579
12:57:35 PM: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12:57:35 PM: Packages are hard linked from the content-addressable store to the virtual store.
12:57:35 PM: Content-addressable store is at: /opt/build/repo/node_modules/.pnpm-store/v3
12:57:35 PM: Virtual store is at: node_modules/.pnpm
12:57:36 PM: Progress: resolved 1579, reused 0, downloaded 14, added 10
12:57:37 PM: Progress: resolved 1579, reused 0, downloaded 82, added 74
12:57:38 PM: Progress: resolved 1579, reused 0, downloaded 167, added 156
12:57:39 PM: Progress: resolved 1579, reused 0, downloaded 258, added 253
12:57:40 PM: Progress: resolved 1579, reused 0, downloaded 333, added 329
12:57:41 PM: Progress: resolved 1579, reused 0, downloaded 416, added 406
12:57:42 PM: Progress: resolved 1579, reused 0, downloaded 507, added 503
12:57:43 PM: Progress: resolved 1579, reused 0, downloaded 629, added 622
12:57:44 PM: Progress: resolved 1579, reused 0, downloaded 730, added 721
12:57:45 PM: Progress: resolved 1579, reused 0, downloaded 869, added 867
12:57:46 PM: Progress: resolved 1579, reused 0, downloaded 1091, added 1085
12:57:47 PM: Progress: resolved 1579, reused 0, downloaded 1236, added 1228
12:57:48 PM: Progress: resolved 1579, reused 0, downloaded 1327, added 1322
12:57:49 PM: Progress: resolved 1579, reused 0, downloaded 1390, added 1389
12:57:50 PM: Progress: resolved 1579, reused 0, downloaded 1460, added 1460
12:57:51 PM: Progress: resolved 1579, reused 0, downloaded 1567, added 1564
12:57:52 PM: Progress: resolved 1579, reused 0, downloaded 1576, added 1577
12:57:52 PM: ERR_PNPM_PREPARE_PKG_FAILURE Command failed with exit code 1: /opt/buildhome/.nvm/versions/node/v16.15.1/bin/npm install (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
12:57:53 PM: ​
12:57:53 PM: ────────────────────────────────────────────────────────────────
12:57:53 PM: “build.command” failed
12:57:53 PM: ────────────────────────────────────────────────────────────────
12:57:53 PM: ​
12:57:53 PM: Error message
12:57:53 PM: Command failed with exit code 1: npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store && npx pnpm run generate (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
12:57:53 PM: ​
12:57:53 PM: Error location
12:57:53 PM: In build.command from netlify.toml:
12:57:53 PM: npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store && npx pnpm run generate
12:57:53 PM: ​
12:57:53 PM: Resolved config
12:57:53 PM: build:
12:57:53 PM: command: npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store && npx pnpm run generate
12:57:53 PM: commandOrigin: config
12:57:53 PM: environment:
12:57:53 PM: - NPM_FLAGS
12:57:53 PM: publish: /opt/build/repo/dist
12:57:53 PM: publishOrigin: ui
12:57:53 PM: functionsDirectory: /opt/build/repo/netlify/functions
12:57:53 PM: Caching artifacts
12:57:53 PM: Started saving node modules
12:57:53 PM: Finished saving node modules
12:57:53 PM: Started saving build plugins
12:57:53 PM: Finished saving build plugins
12:57:53 PM: Started saving pip cache
12:57:53 PM: Finished saving pip cache
12:57:53 PM: Started saving emacs cask dependencies
12:57:53 PM: Finished saving emacs cask dependencies
12:57:53 PM: Started saving maven dependencies
12:57:53 PM: Finished saving maven dependencies
12:57:53 PM: Started saving boot dependencies
12:57:53 PM: Finished saving boot dependencies
12:57:53 PM: Started saving rust rustup cache
12:57:53 PM: Finished saving rust rustup cache
12:57:53 PM: Started saving go dependencies
12:57:53 PM: Finished saving go dependencies
12:57:56 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:57:56 PM: Creating deploy upload records
12:57:56 PM: Failing build: Failed to build site
12:57:56 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)
12:57:56 PM: Finished processing build request in 36.690882303s

hi there, i think the problem originates from the above.

we do know that that version of node does break some builds, there might be something useful in here: