Netlify build suddenly ignoring the NODE_VERSION (Failing)

Site Name: https://book-runner.netlify.app

Hi, our node version has suddenly stopped working.

Our Env vars are:

NODE_VERSION=“15.1.0”

4:11:09 PM: Downloading https://nodejs.org/dist/v15.1.0/node-v15.1.0-linux-x64.tar.xz...
4:11:13 PM: Now using node v15.1.0 (npm v7.0.8)

Most recent successful build: Production: master@9be0b4f
First failed Build: Production: master@d519516

Build Error message (Failing plugin which requires node >= 14.15.0)

The Node.js version is 12.22.7 but the plugin "@netlify/plugin-gatsby" requires >=14.15.0

The problem suddenly started today and we haven’t changed any env variables

Any help would be highly appreciated!

Full build log:

4:11:02 PM: Build ready to start
4:11:04 PM: build-image version: 8925038cf853b22d6397cdcb9904ac88b66bb383 (focal)
4:11:04 PM: build-image tag: v4.5.0
4:11:04 PM: buildbot version: c0e8ffa453e19757f422ac0b6b14bc1b57e53b59
4:11:04 PM: Building without cache
4:11:04 PM: Starting to prepare the repo for build
4:11:05 PM: No cached dependencies found. Cloning fresh repo
4:11:05 PM: git clone git@github.com:dot-development/book-runner
4:11:06 PM: Preparing Git Reference refs/heads/master
4:11:07 PM: Parsing package.json dependencies
4:11:08 PM: Starting build script
4:11:08 PM: Installing dependencies
4:11:08 PM: Python version set to 2.7
4:11:09 PM: Downloading and installing node v15.1.0...
4:11:09 PM: Downloading https://nodejs.org/dist/v15.1.0/node-v15.1.0-linux-x64.tar.xz...
4:11:09 PM: Computing checksum with sha256sum
4:11:09 PM: Checksums matched!
4:11:13 PM: Now using node v15.1.0 (npm v7.0.8)
4:11:13 PM: Started restoring cached build plugins
4:11:13 PM: Finished restoring cached build plugins
4:11:13 PM: Attempting ruby version 2.7.2, read from environment
4:11:15 PM: Using ruby version 2.7.2
4:11:15 PM: Using PHP version 8.0
4:11:15 PM: Started restoring cached yarn cache
4:11:15 PM: Finished restoring cached yarn cache
4:11:16 PM: No yarn workspaces detected
4:11:16 PM: Started restoring cached node modules
4:11:16 PM: Finished restoring cached node modules
4:11:16 PM: Installing NPM modules using Yarn version 1.22.10
4:11:16 PM: yarn install v1.22.10
4:11:17 PM: [1/4] Resolving packages...
4:11:18 PM: [2/4] Fetching packages...
4:12:01 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
4:12:01 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
4:12:01 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
4:12:01 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
4:12:01 PM: [3/4] Linking dependencies...
4:12:01 PM: warning " > @sanity/imagetool@2.21.10" has unmet peer dependency "prop-types@^15.6 || ^16".
4:12:01 PM: warning " > @sanity/imagetool@2.21.10" has unmet peer dependency "styled-components@^5.2.0".
4:12:01 PM: warning " > babel-preset-gatsby@1.14.0" has unmet peer dependency "core-js@^3.0.0".
4:12:01 PM: warning " > eslint-import-resolver-alias@1.1.2" has unmet peer dependency "eslint-plugin-import@>=1.4.0".
4:12:01 PM: warning " > babel-loader@8.2.3" has unmet peer dependency "webpack@>=2".
4:12:01 PM: warning "gatsby > eslint-config-react-app@6.0.0" has unmet peer dependency "babel-eslint@^10.0.0".
4:12:01 PM: warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
4:12:01 PM: warning "gatsby > eslint-plugin-graphql > graphql-config > @endemolshinegroup/cosmiconfig-typescript-loader > ts-node@9.1.1" has unmet peer dependency "typescript@>=2.7".
4:12:01 PM: warning " > gatsby-plugin-advanced-sitemap@2.0.0" has incorrect peer dependency "gatsby@^3.0.0".
4:12:01 PM: warning " > gatsby-plugin-emotion@6.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-plugin-gatsby-cloud@2.11.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning "gatsby-plugin-gatsby-cloud > webpack-assets-manifest@5.0.6" has unmet peer dependency "webpack@^5.2.0".
4:12:01 PM: warning " > gatsby-plugin-google-analytics@3.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-plugin-google-gtag@3.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-plugin-image@1.14.2" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning "gatsby-plugin-image > babel-plugin-remove-graphql-queries@3.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-plugin-layout@2.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-plugin-manifest@3.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning "gatsby-plugin-manifest > gatsby-plugin-utils@1.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-plugin-react-helmet@4.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-plugin-sharp@3.14.3" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-plugin-sitemap@3.3.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-source-filesystem@3.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > gatsby-transformer-sharp@3.14.0" has incorrect peer dependency "gatsby@^3.0.0-next.0".
4:12:01 PM: warning " > react-json-view-ssr@1.19.1" has incorrect peer dependency "react@^16.0.0 || ^15.5.4".
4:12:01 PM: warning " > react-json-view-ssr@1.19.1" has incorrect peer dependency "react-dom@^16.0.0 || ^15.5.4".
4:12:01 PM: warning "react-json-view-ssr > flux@3.1.3" has incorrect peer dependency "react@^15.0.2 || ^16.0.0-beta || ^16.0.0".
4:12:01 PM: warning "react-json-view-ssr > react-textarea-autosize@6.1.0" has incorrect peer dependency "react@>=0.14.0 <17.0.0".
4:12:01 PM: warning " > use-query-params@1.2.3" has unmet peer dependency "query-string@>=5.1.1".
4:12:01 PM: warning "use-query-params > serialize-query-params@1.3.5" has unmet peer dependency "query-string@>=5.1.1".
4:12:01 PM: warning " > dotenv-webpack@6.0.4" has unmet peer dependency "webpack@^1 || ^2 || ^3 || ^4 || ^5".
4:12:28 PM: [4/4] Building fresh packages...
4:12:34 PM: Done in 77.47s.
4:12:34 PM: NPM modules installed using Yarn
4:12:34 PM: Started restoring cached go cache
4:12:34 PM: Finished restoring cached go cache
4:12:34 PM: go version go1.16.5 linux/amd64
4:12:34 PM: go version go1.16.5 linux/amd64
4:12:34 PM: Installing missing commands
4:12:34 PM: Verify run directory
4:12:36 PM: ​
4:12:36 PM: ────────────────────────────────────────────────────────────────
4:12:36 PM:   Netlify Build                                                 
4:12:36 PM: ────────────────────────────────────────────────────────────────
4:12:36 PM: ​
4:12:36 PM: ❯ Version
4:12:36 PM:   @netlify/build 19.0.6
4:12:36 PM: ​
4:12:36 PM: ❯ Flags
4:12:36 PM:   baseRelDir: true
4:12:36 PM:   buildId: 61a06c665f0e91db1e0a92a2
4:12:36 PM:   deployId: 61a06c665f0e91db1e0a92a4
4:12:36 PM: ​
4:12:36 PM: ❯ Current directory
4:12:36 PM:   /opt/build/repo
4:12:36 PM: ​
4:12:36 PM: ❯ Config file
4:12:36 PM:   /opt/build/repo/netlify.toml
4:12:36 PM: ​
4:12:36 PM: ❯ Context
4:12:36 PM:   production
4:12:36 PM: ​
4:12:36 PM: ────────────────────────────────────────────────────────────────
4:12:36 PM:   Configuration error                                           
4:12:36 PM: ────────────────────────────────────────────────────────────────
4:12:36 PM: ​
4:12:36 PM:   Error message
4:12:36 PM:   The Node.js version is 12.22.7 but the plugin "@netlify/plugin-gatsby" requires >=14.15.0
4:12:36 PM: ​
4:12:36 PM:   Resolved config
4:12:36 PM:   build:
4:12:36 PM:     command: yarn build
4:12:36 PM:     commandOrigin: config
4:12:36 PM:     environment:
4:12:36 PM:       - AWS_LAMBDA_JS_RUNTIME
4:12:36 PM:       - ENABLE_GATSBY_REFRESH_ENDPOINT
4:12:36 PM:       - GATSBY_PREVIEW_INDICATOR_ENABLED
4:12:36 PM:       - GATSBY_SANITY_API_TOKEN
4:12:36 PM:       - GATSBY_SANITY_DATASET
4:12:36 PM:       - GATSBY_SANITY_PROJECT_ID
4:12:36 PM:       - GATSBY_SHOPIFY_API_KEY
4:12:36 PM:       - GATSBY_SHOPIFY_GRAPHQL_URL
4:12:36 PM:       - GATSBY_SHOPIFY_PASSWORD
4:12:36 PM:       - GATSBY_SHOPIFY_SECRET
4:12:36 PM:       - GATSBY_SHOPIFY_STORE
4:12:36 PM:       - GATSBY_SHOPIFY_TOKEN
4:12:36 PM:       - NODE_VERSION
4:12:36 PM:     publish: /opt/build/repo/public
4:12:36 PM:     publishOrigin: config
4:12:36 PM:   plugins:
4:12:36 PM:     - inputs: {}
4:12:36 PM:       origin: config
4:12:36 PM:       package: '@netlify/plugin-gatsby'
4:12:36 PM: Caching artifacts
4:12:36 PM: Started saving node modules
4:12:36 PM: Finished saving node modules
4:12:36 PM: Started saving build plugins
4:12:36 PM: Finished saving build plugins
4:12:36 PM: Started saving yarn cache
4:12:44 PM: Finished saving yarn cache
4:12:44 PM: Started saving pip cache
4:12:44 PM: Finished saving pip cache
4:12:44 PM: Started saving emacs cask dependencies
4:12:44 PM: Finished saving emacs cask dependencies
4:12:44 PM: Started saving maven dependencies
4:12:44 PM: Finished saving maven dependencies
4:12:44 PM: Started saving boot dependencies
4:12:45 PM: Finished saving boot dependencies
4:12:45 PM: Started saving rust rustup cache
4:12:45 PM: Finished saving rust rustup cache
4:12:45 PM: Started saving go dependencies
4:12:45 PM: Finished saving go dependencies
4:12:47 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:12:47 PM: Creating deploy upload records
4:12:47 PM: Failing build: Failed to build site
4:12:47 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
4:12:47 PM: Finished processing build request in 1m43.355049123s

Hi @tait

Suggest this is to do with functions which require the AWS_LAMBDA_JS_RUNTIME not the NODE_VERSION environment variable (see documentation for how to set.)

1 Like

Hi Coelmay,

Thanks for your reply!

The AWS_LAMBDA_JS_RUNTIME is set to nodejs14.x - this was working for 2 weeks with Gatsby V4 but has now suddenly stopped working.

Setting it to nodejs15.x doesn’t fix the build error

Kind Regards,

Tait

As per AWS Lambda runtimes documentation nodejs15.x is not a supported version (10, 12, 14 are).

Hi Coelmay,

We have experienced this issue on all three of our sites which had AWS_LAMBDA_JS_RUNTIME set to nodejs14.x already.

These are https://jw-places.netlify.app, https://hossein-film.netlify.app and https://book-runner.netlify.app

Do you have a recommendation for what steps to take?

You mentioned in your original post you haven’t changed any of the environment variables. I wonder if you have changed any of the package versions, or the version of @netlify/plugin-gatsby used in your build? This might explain why builds started failing.

It does mention on the netlify-plugin-gatsby documentation to set

AWS_LAMBDA_JS_RUNTIME to nodejs14.x

As I am not a Gatsby user, I am unable to offer specific advice in this situation. I know there are some community members well versed in Gatsby on Netlify who can offer more assistance than I can.

Hi Coelmay,

Thanks again!

We haven’t changed any of the package versions either.
The crux of the issue seems to be that it’s not using nodejs 14 for the functions server

Below are our package.json dependancies which show that the plugins are configured as per the readme here: GitHub - netlify/netlify-plugin-gatsby: A build plugin to integrate Gatsby seamlessly with Netlify

    "@netlify/plugin-gatsby": "^2.0.0-beta",
    "gatsby-plugin-netlify": "^4.0.0-next.0",
    "netlify-lambda": "^2.0.8",
    "netlify-plugin-gatsby-cache": "^0.3.2",

and script:

"build-functions": "netlify-lambda build src/functions",

If you are not able to offer advice on the issue. Would you kindly be able to recommend a way to get the attention of the community members well versed in Gatsby on Netlify?

Thanks,

Tait

The deploy log that you’ve shared seems to be using nodejs15.x which is unsupported configuration. Could you share the log in which you’ve used 14?

I have the same issue
AWS_LAMBDA_JS_RUNTIME: nodejs14.x
was set in env vars via the UI

error message during build:

The Node.js version is 12.22.7 but the plugin "@netlify/plugin-gatsby" requires >=14.15.0