The Netlify deploy errored, with the following guidance provided:
Diagnosis
- The build reaches the
npm run build step and Gatsby aborts with Error: Gatsby requires Node.js 18, 20, or 16 LTS. You are using 22.22.0 (line 210). Netlify’s default Node 22 is newer than the version range supported by the project’s Gatsby CLI (line 214), so the build exits with code 1.
Solution
- Pin the build to a supported Node version (e.g., Node 20). Add the following to
netlify.toml (or update the existing [build.environment] block) and commit the change:
[build.environment]
NODE_VERSION = "20"
- Alternatively, you can add an
.nvmrc containing 20 and ensure it is committed so Netlify picks it up.
- Re-run the build. For details on setting the Node.js version in Netlify, see the documentation: https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript
The relevant error logs are:
Line 0: Build ready to start
Line 1: build-image version: d51fd32053fcc0da4148dc46bb6db7c33c7d9b1f (noble)
Line 2: buildbot version: 7b42408d228e64fed2c2b460270e11dbdfb99f12
Line 3: Fetching cached dependencies
Line 4: Failed to fetch cache, continuing with build
Line 5: Starting to prepare the repo for build
Line 6: No cached dependencies found. Cloning fresh repo
Line 7: git clone --filter=blob:none https://github.com/ncihtan/htan-portal
Line 8: Preparing Git Reference pull/858/head
Line 9: Starting to install dependencies
Line 10: v22.22.0 is already installed.
Line 11: Now using node v22.22.0 (npm v10.9.4)
Line 12: Enabling Node.js Corepack
Line 13: Started restoring cached build plugins
Line 14: Finished restoring cached build plugins
Line 44: warning "victory > victory-bar@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 45: warning "victory > victory-box-plot@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 46: warning "victory > victory-brush-container@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 47: warning "victory > victory-brush-line@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 48: warning "victory > victory-candlestick@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 49: warning "victory > victory-canvas@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 50: warning "victory > victory-chart@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 51: warning "victory > victory-core@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 52: warning "victory > victory-create-container@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 53: warning "victory > victory-cursor-container@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 54: warning "victory > victory-errorbar@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 55: warning "victory > victory-group@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 56: warning "victory > victory-histogram@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 57: warning "victory > victory-legend@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 58: warning "victory > victory-line@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 59: warning "victory > victory-pie@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 60: warning "victory > victory-polar-axis@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 61: warning "victory > victory-scatter@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 62: warning "victory > victory-selection-container@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 63: warning "victory > victory-shared-events@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 64: warning "victory > victory-stack@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
The Netlify deploy errored, with the following guidance provided:
Diagnosis
npm run buildstep and Gatsby aborts withError: Gatsby requires Node.js 18, 20, or 16 LTS. You are using 22.22.0(line 210). Netlify’s default Node 22 is newer than the version range supported by the project’s Gatsby CLI (line 214), so the build exits with code 1.Solution
netlify.toml(or update the existing[build.environment]block) and commit the change:.nvmrccontaining20and ensure it is committed so Netlify picks it up.The relevant error logs are:
Line 0: Build ready to start
Line 1: build-image version: d51fd32053fcc0da4148dc46bb6db7c33c7d9b1f (noble)
Line 2: buildbot version: 7b42408d228e64fed2c2b460270e11dbdfb99f12
Line 3: Fetching cached dependencies
Line 4: Failed to fetch cache, continuing with build
Line 5: Starting to prepare the repo for build
Line 6: No cached dependencies found. Cloning fresh repo
Line 7: git clone --filter=blob:none https://github.com/ncihtan/htan-portal
Line 8: Preparing Git Reference pull/858/head
Line 9: Starting to install dependencies
Line 10: v22.22.0 is already installed.
Line 11: Now using node v22.22.0 (npm v10.9.4)
Line 12: Enabling Node.js Corepack
Line 13: Started restoring cached build plugins
Line 14: Finished restoring cached build plugins
Line 44: warning "victory > victory-bar@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 45: warning "victory > victory-box-plot@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 46: warning "victory > victory-brush-container@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 47: warning "victory > victory-brush-line@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 48: warning "victory > victory-candlestick@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 49: warning "victory > victory-canvas@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 50: warning "victory > victory-chart@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 51: warning "victory > victory-core@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 52: warning "victory > victory-create-container@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 53: warning "victory > victory-cursor-container@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 54: warning "victory > victory-errorbar@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 55: warning "victory > victory-group@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 56: warning "victory > victory-histogram@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 57: warning "victory > victory-legend@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 58: warning "victory > victory-line@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 59: warning "victory > victory-pie@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 60: warning "victory > victory-polar-axis@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 61: warning "victory > victory-scatter@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 62: warning "victory > victory-selection-container@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 63: warning "victory > victory-shared-events@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".
Line 64: warning "victory > victory-stack@36.2.0" has incorrect peer dependency "react@^16.6.0 || ^17.0.0".