Node v16.15.0 (npm v8.5.5) was updated to v16.15.1 (npm v8.11.0) on June 1, which broke about half of my deployed sites.
For others having this problem: To fix, either revert back to v16.15.0 or use npm flags. Set the env variable NPM_FLAGS
to --legacy-peer-deps
in Netlify’s dashboard, or set the variable NODE_VERSION
to 16.15.0
in the dashboard or using a .nvmrc
file.
Error log:
7:55:43 PM: Build ready to start
7:56:51 PM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
7:56:51 PM: build-image tag: v4.8.0
7:56:51 PM: buildbot version: 4aaa27647e859c2d38cfbb25901ceae1e7f3eeae
7:56:51 PM: Fetching cached dependencies
7:57:02 PM: Finished downloading cache in 11.233987149s
7:57:02 PM: Starting to extract cache
7:57:35 PM: Finished extracting cache in 32.620340344s
7:57:35 PM: Finished fetching cache in 43.972713102s
7:57:35 PM: Starting to prepare the repo for build
7:57:35 PM: Preparing Git Reference refs/heads/main
7:57:36 PM: Parsing package.json dependencies
7:57:36 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'netlify/functions' versus '' in the Netlify UI
7:57:37 PM: Starting build script
7:57:37 PM: Installing dependencies
7:57:37 PM: Python version set to 2.7
7:57:37 PM: Started restoring cached node version
7:57:38 PM: Finished restoring cached node version
7:57:38 PM: Attempting node version 'v16' from .nvmrc
7:57:38 PM: Downloading and installing node v16.15.1...
7:57:39 PM: Downloading https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz...
7:57:39 PM: Computing checksum with sha256sum
7:57:39 PM: Checksums matched!
7:57:42 PM: Now using node v16.15.1 (npm v8.11.0)
7:57:42 PM: Started restoring cached build plugins
7:57:42 PM: Finished restoring cached build plugins
7:57:42 PM: Attempting ruby version 2.7.2, read from environment
7:57:43 PM: Using ruby version 2.7.2
7:57:44 PM: Using PHP version 8.0
7:57:44 PM: No npm workspaces detected
7:57:44 PM: Started restoring cached node modules
7:57:44 PM: Finished restoring cached node modules
7:57:45 PM: Installing NPM modules using NPM version 8.11.0
7:57:45 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
7:57:45 PM: npm WARN config location in the cache, and they are managed by
7:57:45 PM: npm WARN config [`cacache`](http://npm.im/cacache).
7:57:46 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
7:57:46 PM: npm WARN config location in the cache, and they are managed by
7:57:46 PM: npm WARN config [`cacache`](http://npm.im/cacache).
7:57:49 PM: npm WARN ERESOLVE overriding peer dependency
7:57:49 PM: npm WARN While resolving: eslint-config-react-app@6.0.0
7:57:49 PM: npm WARN Found: @typescript-eslint/eslint-plugin@5.23.0
7:57:49 PM: npm WARN node_modules/@typescript-eslint/eslint-plugin
7:57:49 PM: npm WARN dev @typescript-eslint/eslint-plugin@"^5.23.0" from the root project
7:57:49 PM: npm WARN
7:57:49 PM: npm WARN Could not resolve dependency:
7:57:49 PM: npm WARN peer @typescript-eslint/eslint-plugin@"^4.0.0" from eslint-config-react-app@6.0.0
7:57:49 PM: npm WARN node_modules/eslint-config-react-app
7:57:49 PM: npm WARN eslint-config-react-app@"^6.0.0" from gatsby@4.14.0
7:57:49 PM: npm WARN node_modules/gatsby
7:57:49 PM: npm WARN
7:57:49 PM: npm WARN Conflicting peer dependency: @typescript-eslint/eslint-plugin@4.33.0
7:57:49 PM: npm WARN node_modules/@typescript-eslint/eslint-plugin
7:57:49 PM: npm WARN peer @typescript-eslint/eslint-plugin@"^4.0.0" from eslint-config-react-app@6.0.0
7:57:49 PM: npm WARN node_modules/eslint-config-react-app
7:57:49 PM: npm WARN eslint-config-react-app@"^6.0.0" from gatsby@4.14.0
7:57:49 PM: npm WARN node_modules/gatsby
7:57:49 PM: npm WARN ERESOLVE overriding peer dependency
7:57:49 PM: npm WARN While resolving: eslint-config-react-app@6.0.0
7:57:50 PM: Creating deploy upload records
7:57:49 PM: npm WARN Found: @typescript-eslint/parser@5.23.0
7:57:49 PM: npm WARN node_modules/@typescript-eslint/parser
7:57:49 PM: npm WARN dev @typescript-eslint/parser@"^5.23.0" from the root project
7:57:49 PM: npm WARN 1 more (@typescript-eslint/eslint-plugin)
7:57:49 PM: npm WARN
7:57:49 PM: npm WARN Could not resolve dependency:
7:57:50 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
7:57:49 PM: npm WARN peer @typescript-eslint/parser@"^4.0.0" from eslint-config-react-app@6.0.0
7:57:49 PM: npm WARN node_modules/eslint-config-react-app
7:57:49 PM: npm WARN eslint-config-react-app@"^6.0.0" from gatsby@4.14.0
7:57:49 PM: npm WARN node_modules/gatsby
7:57:49 PM: npm WARN
7:57:49 PM: npm WARN Conflicting peer dependency: @typescript-eslint/parser@4.33.0
7:57:49 PM: npm WARN node_modules/@typescript-eslint/parser
7:57:49 PM: npm WARN peer @typescript-eslint/parser@"^4.0.0" from eslint-config-react-app@6.0.0
7:57:49 PM: npm WARN node_modules/eslint-config-react-app
7:57:49 PM: npm WARN eslint-config-react-app@"^6.0.0" from gatsby@4.14.0
7:57:49 PM: npm WARN node_modules/gatsby
7:57:49 PM: npm WARN ERESOLVE overriding peer dependency
7:57:49 PM: npm WARN While resolving: eslint-config-react-app@6.0.0
7:57:49 PM: npm WARN Found: eslint@8.15.0
7:57:49 PM: npm WARN node_modules/eslint
7:57:49 PM: npm WARN dev eslint@"^8.15.0" from the root project
7:57:49 PM: npm WARN 17 more (@babel/eslint-parser, ...)
7:57:49 PM: npm WARN
7:57:49 PM: npm WARN Could not resolve dependency:
7:57:49 PM: npm WARN peer eslint@"^7.5.0" from eslint-config-react-app@6.0.0
7:57:49 PM: npm WARN node_modules/eslint-config-react-app
7:57:49 PM: npm WARN eslint-config-react-app@"^6.0.0" from gatsby@4.14.0
7:57:49 PM: npm WARN node_modules/gatsby
7:57:49 PM: npm WARN
7:57:49 PM: npm WARN Conflicting peer dependency: eslint@7.32.0
7:57:49 PM: npm WARN node_modules/eslint
7:57:49 PM: npm WARN peer eslint@"^7.5.0" from eslint-config-react-app@6.0.0
7:57:49 PM: npm WARN node_modules/eslint-config-react-app
7:57:49 PM: npm WARN eslint-config-react-app@"^6.0.0" from gatsby@4.14.0
7:57:49 PM: npm WARN node_modules/gatsby
7:57:50 PM: npm WARN ERESOLVE overriding peer dependency
7:57:50 PM: npm WARN While resolving: eslint-plugin-flowtype@5.10.0
7:57:50 PM: npm WARN Found: eslint@8.15.0
7:57:50 PM: npm WARN node_modules/eslint
7:57:50 PM: npm WARN dev eslint@"^8.15.0" from the root project
7:57:50 PM: npm WARN 17 more (@babel/eslint-parser, ...)
7:57:50 PM: npm WARN
7:57:50 PM: npm WARN Could not resolve dependency:
7:57:50 PM: npm WARN peer eslint@"^7.1.0" from eslint-plugin-flowtype@5.10.0
7:57:50 PM: npm WARN node_modules/eslint-plugin-flowtype
7:57:50 PM: npm WARN peer eslint-plugin-flowtype@"^5.2.0" from eslint-config-react-app@6.0.0
7:57:50 PM: npm WARN node_modules/eslint-config-react-app
7:57:50 PM: npm WARN 1 more (gatsby)
7:57:50 PM: npm WARN
7:57:50 PM: npm WARN Conflicting peer dependency: eslint@7.32.0
7:57:50 PM: npm WARN node_modules/eslint
7:57:50 PM: npm WARN peer eslint@"^7.1.0" from eslint-plugin-flowtype@5.10.0
7:57:50 PM: npm WARN node_modules/eslint-plugin-flowtype
7:57:50 PM: npm WARN peer eslint-plugin-flowtype@"^5.2.0" from eslint-config-react-app@6.0.0
7:57:50 PM: npm WARN node_modules/eslint-config-react-app
7:57:50 PM: npm WARN 1 more (gatsby)
7:57:50 PM: npm ERR! code ERESOLVE
7:57:50 PM: npm ERR! ERESOLVE could not resolve
7:57:50 PM: npm ERR!
7:57:50 PM: npm ERR! While resolving: gatsby-plugin-multi-language-sitemap@1.1.0
7:57:50 PM: npm ERR! Found: gatsby@4.14.0
7:57:50 PM: npm ERR! node_modules/gatsby
7:57:50 PM: npm ERR! gatsby@"^4.14.0" from the root project
7:57:50 PM: npm ERR! peer gatsby@"^4.0.0-next" from babel-plugin-remove-graphql-queries@4.14.0
7:57:50 PM: npm ERR! node_modules/babel-plugin-remove-graphql-queries
7:57:50 PM: npm ERR! babel-plugin-remove-graphql-queries@"^4.14.0" from gatsby@4.14.0
7:57:50 PM: npm ERR! babel-plugin-remove-graphql-queries@"^4.14.0" from gatsby-plugin-image@2.14.1
7:57:50 PM: npm ERR! node_modules/gatsby-plugin-image
7:57:50 PM: npm ERR! gatsby-plugin-image@"^2.14.1" from the root project
7:57:50 PM: npm ERR! 1 more (gatsby-source-datocms)
7:57:50 PM: npm ERR! 1 more (gatsby-plugin-typescript)
7:57:50 PM: npm ERR! 18 more (gatsby-plugin-emotion, gatsby-plugin-eslint, ...)
7:57:50 PM: npm ERR!
7:57:50 PM: npm ERR! Could not resolve dependency:
7:57:50 PM: npm ERR! peer gatsby@"^3.0.0-next.0" from gatsby-plugin-multi-language-sitemap@1.1.0
7:57:50 PM: npm ERR! node_modules/gatsby-plugin-multi-language-sitemap
7:57:50 PM: npm ERR! gatsby-plugin-multi-language-sitemap@"^1.1.0" from the root project
7:57:50 PM: npm ERR!
7:57:50 PM: npm ERR! Conflicting peer dependency: gatsby@3.14.6
7:57:50 PM: npm ERR! node_modules/gatsby
7:57:50 PM: npm ERR! peer gatsby@"^3.0.0-next.0" from gatsby-plugin-multi-language-sitemap@1.1.0
7:57:50 PM: npm ERR! node_modules/gatsby-plugin-multi-language-sitemap
7:57:50 PM: npm ERR! gatsby-plugin-multi-language-sitemap@"^1.1.0" from the root project
7:57:50 PM: npm ERR!
7:57:50 PM: npm ERR! Fix the upstream dependency conflict, or retry
7:57:50 PM: npm ERR! this command with --force, or --legacy-peer-deps
7:57:50 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
7:57:50 PM: npm ERR!
7:57:50 PM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
7:57:50 PM: npm ERR! A complete log of this run can be found in:
7:57:50 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-06-01T23_57_45_984Z-debug-0.log
7:57:50 PM: Error during NPM install
7:57:50 PM: Build was terminated: Build script returned non-zero exit code: 1
7:57:50 PM: Failing build: Failed to build site
7:57:51 PM: Finished processing build request in 59.841606166s