Build failing after upgrade to node 18

Name: https://villy-app.netlify.app/

Build problem: Hey I’ve just updated the CI to use node 18 and my builds are failing just after the plugin-gatsby, not sure if this is the issue but it might be. Here is a link to a failing build:

using node 18 because of the new fetch api added to it, not sure if that’s what’s making issues. Thanks for the help!

8:14:42 PM: Build ready to start
8:14:49 PM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
8:14:49 PM: build-image tag: v4.10.1
8:14:49 PM: buildbot version: 7e449fda4d95fa42451b88186ca7054116649237
8:14:50 PM: Building without cache
8:14:50 PM: Starting to prepare the repo for build
8:14:50 PM: No cached dependencies found. Cloning fresh repo
8:14:50 PM: git clone https://github.com/villy-app/villy
8:14:50 PM: Preparing Git Reference refs/heads/main
8:14:51 PM: Parsing package.json dependencies
8:14:51 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'apps/dashboard/public' versus 'public' in the Netlify UI
8:14:52 PM: Starting build script
8:14:52 PM: Installing dependencies
8:14:52 PM: Python version set to 2.7
8:14:52 PM: Downloading and installing node v18.9.0...
8:14:52 PM: Downloading https://nodejs.org/dist/v18.9.0/node-v18.9.0-linux-x64.tar.xz...
8:14:52 PM: Computing checksum with sha256sum
8:14:52 PM: Checksums matched!
8:14:54 PM: Now using node v18.9.0 (npm v8.19.1)
8:14:55 PM: Started restoring cached build plugins
8:14:55 PM: Finished restoring cached build plugins
8:14:55 PM: Attempting ruby version 2.7.2, read from environment
8:14:55 PM: Using ruby version 2.7.2
8:14:55 PM: Using PHP version 8.0
8:14:56 PM: npm workspaces detected
8:14:56 PM: Installing NPM modules using NPM version 8.19.1
8:14:56 PM: npm ERR! code ENOWORKSPACES
8:14:56 PM: npm ERR! This command does not support workspaces.
8:14:56 PM: npm ERR! A complete log of this run can be found in:
8:14:56 PM: npm ERR!     /opt/buildhome/.npm/_logs/2022-09-18T18_14_56_668Z-debug-0.log
8:15:16 PM: npm WARN ERESOLVE overriding peer dependency
8:15:16 PM: npm WARN While resolving: @graphql-tools/url-loader@7.16.1
8:15:16 PM: npm WARN Found: peer ws@"*" from isomorphic-ws@5.0.0
8:15:16 PM: npm WARN node_modules/@graphql-tools/url-loader/node_modules/isomorphic-ws
8:15:16 PM: npm WARN   isomorphic-ws@"^5.0.0" from @graphql-tools/url-loader@7.16.1
8:15:16 PM: npm WARN   node_modules/@graphql-tools/url-loader
8:15:16 PM: npm WARN
8:15:16 PM: npm WARN Could not resolve dependency:
8:15:16 PM: npm WARN peer ws@"*" from isomorphic-ws@5.0.0
8:15:16 PM: npm WARN node_modules/@graphql-tools/url-loader/node_modules/isomorphic-ws
8:15:16 PM: npm WARN   isomorphic-ws@"^5.0.0" from @graphql-tools/url-loader@7.16.1
8:15:16 PM: npm WARN   node_modules/@graphql-tools/url-loader
8:15:48 PM: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
8:15:48 PM: npm WARN deprecated async-cache@1.1.0: No longer maintained. Use [lru-cache](http://npm.im/lru-cache) version 7.6 or higher, and provide an asynchronous `fetchMethod` option.
8:15:53 PM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
8:15:53 PM: npm WARN deprecated multer@1.4.4: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
8:15:55 PM: npm WARN deprecated @types/stripe@8.0.417: This is a stub types definition. stripe provides its own type definitions, so you do not need this installed.
8:16:17 PM: added 1867 packages, and audited 1869 packages in 1m
8:16:17 PM: 241 packages are looking for funding
8:16:17 PM:   run `npm fund` for details
8:16:17 PM: 24 vulnerabilities (14 moderate, 10 high)
8:16:17 PM: To address issues that do not require attention, run:
8:16:17 PM:   npm audit fix
8:16:17 PM: To address all issues possible (including breaking changes), run:
8:16:17 PM:   npm audit fix --force
8:16:17 PM: Some issues need review, and may require choosing
8:16:17 PM: a different dependency.
8:16:17 PM: Run `npm audit` for details.
8:16:17 PM: NPM modules installed
8:16:17 PM: Started restoring cached go cache
8:16:17 PM: Finished restoring cached go cache
8:16:17 PM: Installing Go version 1.17 (requested 1.17)
8:16:21 PM: unset GOOS;
8:16:21 PM: unset GOARCH;
8:16:21 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
8:16:21 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
8:16:21 PM: go version >&2;
8:16:21 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
8:16:21 PM: go version go1.17 linux/amd64
8:16:21 PM: Installing missing commands
8:16:21 PM: Verify run directory
8:16:22 PM: ​
8:16:22 PM: ────────────────────────────────────────────────────────────────
8:16:22 PM:   Netlify Build                                                 
8:16:22 PM: ────────────────────────────────────────────────────────────────
8:16:22 PM: ​
8:16:22 PM: ❯ Version
8:16:22 PM:   @netlify/build 27.18.1
8:16:22 PM: ​
8:16:22 PM: ❯ Flags
8:16:22 PM:   baseRelDir: true
8:16:22 PM:   buildId: 632760125ddea765a7b614f7
8:16:22 PM:   deployId: 632760125ddea765a7b614f9
8:16:22 PM: ​
8:16:22 PM: ❯ Current directory
8:16:22 PM:   /opt/build/repo/apps/dashboard
8:16:22 PM: ​
8:16:22 PM: ❯ Config file
8:16:22 PM:   /opt/build/repo/apps/dashboard/netlify.toml
8:16:22 PM: ​
8:16:22 PM: ❯ Context
8:16:22 PM:   production
8:16:23 PM: ​
8:16:23 PM: ❯ Loading plugins
8:16:23 PM:    - @netlify/plugin-gatsby@3.4.6 from netlify.toml and package.json
8:16:24 PM: Uncaught exception, the process will now terminate…
8:16:24 PM: Error: Unable to deserialize cloned data due to invalid or unsupported version.
8:16:24 PM:     at parseChannelMessages (node:internal/child_process/serialization:97:20)
8:16:24 PM:     at parseChannelMessages.next (<anonymous>)
8:16:24 PM:     at Pipe.channel.onread (node:internal/child_process:612:18)
8:16:24 PM: Caching artifacts
8:16:24 PM: Started saving workspace root node modules
8:16:24 PM: Finished saving workspace root node modules
8:16:24 PM: Started saving build plugins
8:16:24 PM: Finished saving build plugins
8:16:24 PM: Started saving pip cache
8:16:24 PM: Finished saving pip cache
8:16:24 PM: Started saving emacs cask dependencies
8:16:24 PM: Finished saving emacs cask dependencies
8:16:24 PM: Started saving maven dependencies
8:16:24 PM: Finished saving maven dependencies
8:16:24 PM: Started saving boot dependencies
8:16:24 PM: Finished saving boot dependencies
8:16:24 PM: Started saving rust rustup cache
8:16:24 PM: Finished saving rust rustup cache
8:16:24 PM: Started saving go dependencies
8:16:24 PM: Finished saving go dependencies
8:16:25 PM: Build was terminated: Build script returned non-zero exit code: 1
8:16:25 PM: Creating deploy upload records
8:16:25 PM: Failing build: Failed to build site
8:16:25 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
8:16:25 PM: Finished processing build request in 1m35.571314183s

You cannot use Node 18 in Netlify yet, at least if you’re using build plugins. Downgrading to Node 16 should fix it.

Also, at least until AWS supports Node 18, it should anyways not be used for site builds if you’re also using Netlify Functions.

makes sense, I will downgrade and fix issue from my node 16 and wait for AWS and netlify fully to support 18. Thanks

Hello, there. Is there a way to get notified when Node 18 is supported (like an email)? Thanks in advance.

I don’t think so that’s going to happen. But you can be on the lookout for Node 18 support in AWS Lambda. Once that’s out, I think it’s good time for Netlify to consider supporting it.

We’re already trying to add support, just that, it’s not too much prioritised right now.

Also, your site might build fine using Node 18, only some plugins might now work.

Release 1.65.0 of AWS SAM CLI comes with support for Node.js 18.x. Is there any news on Netlify’s support for NodeJS18 ? Gatsby is no longer supporting any other Node version and that makes working with Gatsby+Netlify a big mess

2 Likes

While Netlify Functions have started supporting Node 18, unfortunately the build system will take some time to add a proper support for Node 18 - at least when using Build Plugins.

If you don’t use any Build Plugins, you should be able to use Node 18 in builds too.

Node v18.1 works with Gatsby.

Are you able to deploy Gatsby that requires version 18.1 on netlify?

Hi @nbangba :wave:t6: ,

Right now 18.1 version is not yet supported on Netlify. We hope to have an update for everyone in the coming weeks.

This is really necessary to support, after all,
the mainstream SSG framework gatsby v5 has requested to upgrade node v18