I am trying to deploy my Gatsby website, and there I am getting this error, I tried and check but it seems like there is something wrong with environment: NODE_VERSION, NPM_FLAGS, SHARP_IGNORE_GLOBAL_LIBVIPS
I have set them in my deployment setting due to no support by netlify for react v18 and due to this I had to set node version v16.
However, it was working fine a month back, for details here is an entire log of a failed deployment. I tried many attempts and looked stack and other platforms for fix but nothing worked.
9:44:25 PM: Waiting for other deploys from your team to complete. Check the queue: https://app.netlify.com/teams/oscar20/builds
9:47:06 PM: Build ready to start
9:47:13 PM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
9:47:13 PM: build-image tag: v4.10.1
9:47:13 PM: buildbot version: 7e449fda4d95fa42451b88186ca7054116649237
9:47:13 PM: Fetching cached dependencies
9:47:13 PM: Starting to download cache of 285.6MB
9:47:16 PM: Finished downloading cache in 3.082556593s
9:47:16 PM: Starting to extract cache
9:47:19 PM: Finished extracting cache in 2.672997948s
9:47:19 PM: Finished fetching cache in 5.842942163s
9:47:19 PM: Starting to prepare the repo for build
9:47:19 PM: Preparing Git Reference refs/heads/master
9:47:20 PM: Parsing package.json dependencies
9:47:21 PM: Starting build script
9:47:21 PM: Installing dependencies
9:47:21 PM: Python version set to 2.7
9:47:21 PM: Started restoring cached node version
9:47:22 PM: Finished restoring cached node version
9:47:22 PM: Attempting node version 'v16.4.2' from .nvmrc
9:47:23 PM: v16.4.2 is already installed.
9:47:23 PM: Now using node v16.4.2 (npm v7.18.1)
9:47:23 PM: Started restoring cached build plugins
9:47:23 PM: Finished restoring cached build plugins
9:47:23 PM: Attempting ruby version 2.6.2, read from environment
9:47:23 PM: Started restoring cached ruby version
9:47:23 PM: Finished restoring cached ruby version
9:47:24 PM: Using ruby version 2.6.2
9:47:24 PM: Using PHP version 8.0
9:47:24 PM: No npm workspaces detected
9:47:24 PM: Started restoring cached node modules
9:47:24 PM: Finished restoring cached node modules
9:47:24 PM: Installing NPM modules using NPM version 7.18.1
9:47:28 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
9:47:38 PM: added 22 packages, removed 161 packages, changed 160 packages, and audited 2241 packages in 13s
9:47:38 PM: 356 packages are looking for funding
9:47:38 PM: run `npm fund` for details
9:47:38 PM: 25 vulnerabilities (6 moderate, 18 high, 1 critical)
9:47:38 PM: To address issues that do not require attention, run:
9:47:38 PM: npm audit fix
9:47:38 PM: To address all issues possible (including breaking changes), run:
9:47:38 PM: npm audit fix --force
9:47:38 PM: Some issues need review, and may require choosing
9:47:38 PM: a different dependency.
9:47:38 PM: Run `npm audit` for details.
9:47:38 PM: NPM modules installed
9:47:38 PM: Started restoring cached go cache
9:47:38 PM: Finished restoring cached go cache
9:47:38 PM: Installing Go version 1.12 (requested 1.12)
9:47:42 PM: unset GOOS;
9:47:42 PM: unset GOARCH;
9:47:42 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
9:47:42 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
9:47:42 PM: go version >&2;
9:47:42 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.12.linux.amd64.env"
9:47:42 PM: go version go1.12 linux/amd64
9:47:42 PM: Installing missing commands
9:47:42 PM: Verify run directory
9:47:43 PM:
9:47:43 PM: ────────────────────────────────────────────────────────────────
9:47:43 PM: Netlify Build
9:47:43 PM: ────────────────────────────────────────────────────────────────
9:47:43 PM:
9:47:43 PM: ❯ Version
9:47:43 PM: @netlify/build 27.18.1
9:47:43 PM:
9:47:43 PM: ❯ Flags
9:47:43 PM: baseRelDir: true
9:47:43 PM: buildId: 6325f261b26f2c000946763d
9:47:43 PM: deployId: 6325f261b26f2c000946763f
9:47:43 PM:
9:47:43 PM: ❯ Current directory
9:47:43 PM: /opt/build/repo
9:47:43 PM:
9:47:43 PM: ❯ Config file
9:47:43 PM: /opt/build/repo/netlify.toml
9:47:43 PM:
9:47:43 PM: ❯ Context
9:47:43 PM: production
9:47:43 PM:
9:47:43 PM: ❯ Installing plugins
9:47:43 PM: - @netlify/plugin-gatsby@3.4.6
9:47:53 PM:
9:47:53 PM: ❯ Loading plugins
9:47:53 PM: - @netlify/plugin-gatsby@3.4.6 from Netlify app
9:47:54 PM:
9:47:54 PM: ────────────────────────────────────────────────────────────────
9:47:54 PM: 1. @netlify/plugin-gatsby (onPreBuild event)
9:47:54 PM: ────────────────────────────────────────────────────────────────
9:47:54 PM:
9:47:54 PM: No Gatsby cache found. Building fresh.
9:47:54 PM:
9:47:54 PM: (@netlify/plugin-gatsby onPreBuild completed in 12ms)
9:47:54 PM:
9:47:54 PM: ────────────────────────────────────────────────────────────────
9:47:54 PM: 2. Build command from Netlify app
9:47:54 PM: ────────────────────────────────────────────────────────────────
9:47:54 PM:
9:47:54 PM: $ gatsby build
9:47:57 PM: success compile gatsby files - 0.744s
9:47:57 PM: success load gatsby config - 0.053s
9:47:58 PM: success load plugins - 0.922s
9:47:58 PM: warning gatsby-plugin-react-helmet: Gatsby now has built-in support for modifying the document head. Learn more at https://gatsby.dev/gatsby-head
9:47:58 PM: success onPreInit - 0.006s
9:47:58 PM: success initialize cache - 0.051s
9:47:58 PM: success copy gatsby files - 0.142s
9:47:58 PM: success Compiling Gatsby Functions - 0.150s
9:47:58 PM: success onPreBootstrap - 0.283s
9:47:58 PM: success createSchemaCustomization - 0.070s
9:48:01 PM: success Checking for changed pages - 0.000s
9:48:01 PM: success source and transform nodes - 2.620s
9:48:02 PM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql
9:48:02 PM: success building schema - 1.602s
9:48:03 PM: success createPages - 0.396s
9:48:03 PM: success createPagesStatefully - 0.309s
9:48:03 PM: info Total nodes: 403, SitePage nodes: 96 (use --verbose for breakdown)
9:48:03 PM: success Checking for changed pages - 0.000s
9:48:03 PM: success onPreExtractQueries - 0.000s
9:48:07 PM: success extract queries from components - 4.002s
9:48:07 PM: success write out redirect data - 0.008s
9:48:07 PM: warning The icon(src/media/images/logo/bhavikji.png) you provided to 'gatsby-plugin-manifest' is not square.
9:48:07 PM: The icons we generate will be square and for the best results we recommend you provide a square icon.
9:48:09 PM: success Build manifest and related icons - 1.911s
9:48:09 PM: success onPostBootstrap - 1.913s
9:48:09 PM: info bootstrap finished - 14.877s
9:48:09 PM: success write out requires - 0.007s
9:48:54 PM: success Building production JavaScript and CSS bundles - 44.902s
9:49:07 PM: success Building HTML renderer - 13.053s
9:49:07 PM: success Execute page configs - 0.032s
9:49:07 PM: success Caching Webpack compilations - 0.000s
9:49:16 PM: success run queries in workers - 8.508s - 97/97 11.40/s
9:51:37 PM:
9:51:37 PM: ────────────────────────────────────────────────────────────────
9:51:37 PM: "build.command" failed
9:51:37 PM: ────────────────────────────────────────────────────────────────
9:51:37 PM:
9:51:37 PM: Error message
9:51:37 PM: Command was killed with SIGKILL (Forced termination): gatsby build
9:51:37 PM:
9:51:37 PM: Error location
9:51:37 PM: In Build command from Netlify app:
9:51:37 PM: gatsby build
9:51:37 PM:
9:51:37 PM: Resolved config
9:51:37 PM: build:
9:51:37 PM: command: gatsby build
9:51:37 PM: commandOrigin: ui
9:51:37 PM: environment:
9:51:37 PM: - NODE_VERSION
9:51:37 PM: - NPM_FLAGS
9:51:37 PM: - SHARP_IGNORE_GLOBAL_LIBVIPS
9:51:37 PM: publish: /opt/build/repo/public
9:51:37 PM: publishOrigin: ui
9:51:37 PM: plugins:
9:51:37 PM: - inputs: {}
9:51:37 PM: origin: ui
9:51:37 PM: package: '@netlify/plugin-gatsby'
9:51:37 PM: redirects:
9:51:37 PM: - from: /blog/89ff4b7d-152d-4806-a05d-29b52d2d58a8
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/prologue
9:51:37 PM: - from: /blog/8a7c8d41-c950-4074-8514-3d5d3afc78a2
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/manto-film-review
9:51:37 PM: - from: /blog/44320b9c-c5cd-4593-a4ed-3d4727c839af
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/alexander-the-great-and-the-fountain-of-youth
9:51:37 PM: - from: /tribunals/4e9a07c2-b811-4d72-985b-5fab0e73ff4c
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/jagjit-singh-the-ghazal-maestro
9:51:37 PM: - from: /blog/4f85c557-f990-4a4a-a56a-9f6de631efd4
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/thank-you
9:51:37 PM: - from: /tribunals/f16099f1-f23e-4bfa-b6f7-86a2ad4b8434
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/tabu-a-timeless-artist
9:51:37 PM: - from: /tribunals/3840bb03-1301-4b90-9373-32f686d708c9
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/allama-iqbal-distinguished-philosopher-failed-politician
9:51:37 PM: - from: /tribunals/df14f1b8-2ed5-41db-8308-00a9f314eb14
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/stan-marvellous-lee
9:51:37 PM: - from: /blog/the-political-dilemma-of-rajasthan
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/cc176bf3-4428-4684-9470-dbef9d0a56e0
9:51:37 PM: - from: /blog/798a0d47-50e0-48a9-8633-dc77c456d9c4
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/uri-the-surgical-strike-movie-review
9:51:37 PM: - from: /tribunals/62cfd5af-766c-4e97-89d0-c751cab96eb3
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/bob-marley-in-rajasthan
9:51:37 PM: - from: /blog/74384b28-0ee8-4756-900d-c0eab7ff727b
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/war-between-keyboard-warriors
9:51:37 PM: - from: /blog/4bcdb591-42fa-445e-8fec-92faac943260
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/kesari-movie-review
9:51:37 PM: - from: /blog/c255f939-b90b-4b79-8213-f2ff31d1b8c7
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/things-not-to-do-in-arunachal-pradesh
9:51:37 PM: - from: /blog/ad229199-15d8-4ca6-8b1e-c84ac4b03039
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/current-economic-slowdown-is-just-a-teaser-the-show-is-about-to-appear
9:51:37 PM: - from: /blog/why-indian-media-are-not-showing-what-international-media-are-showing-about-kashmir
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/a0e285f8-f436-466f-b41c-472f4cd9c581
9:51:37 PM: - from: /blog/88a46e09-71c1-41d7-ae76-d94a7f6bd7d1
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/subramanian-swamy-swami-of-own
9:51:37 PM: - from: /blog/4c50c54f-8c19-4def-a2c2-5a2be85ee18f
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/backpacking-in-arunachal-pradesh-part-1
9:51:37 PM: - from: /blog/cc6523de-c989-440d-ae69-15b79619c657
9:51:37 PM: query:
9:51:37 PM: path: ':path'
9:51:37 PM: status: 301
9:51:37 PM: to: /blog/integer-to-words-converter-in-laravel
9:51:38 PM: - from: /* status: 200 to: /index.html redirectsOrigin: configCaching artifacts
9:51:38 PM: Started saving node modules
9:51:38 PM: Finished saving node modules
9:51:38 PM: Started saving build plugins
9:51:38 PM: Finished saving build plugins
9:51:38 PM: Started saving pip cache
9:51:38 PM: Finished saving pip cache
9:51:38 PM: Started saving emacs cask dependencies
9:51:38 PM: Finished saving emacs cask dependencies
9:51:38 PM: Started saving maven dependencies
9:51:38 PM: Finished saving maven dependencies
9:51:38 PM: Started saving boot dependencies
9:51:38 PM: Finished saving boot dependencies
9:51:38 PM: Started saving rust rustup cache
9:51:38 PM: Finished saving rust rustup cache
9:51:38 PM: Started saving go dependencies
9:51:38 PM: Finished saving go dependencies
9:51:38 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:51:38 PM: Creating deploy upload records
9:51:38 PM: Failing build: Failed to build site
9:51:38 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:51:38 PM: Finished processing build request in 4m25.388200584s
Thank you in advance.