question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting Netlify deploy failures due to Node.js version?

See original GitHub issue

Node.js v16.x entered Long Term Support (LTS) on October 27th. For some deployment configurations, this might have caused your Netlify Build to fail. Here’s what might be going on.

How it works

1. Check your Node.js engine version in ./package.json Example:

...
  "engines": {
    "node": ">=14.x",
    "yarn": ">=1.15"
  },
...

2. Then check your .nvmrc file Example:

lts/*

Does your project have similar settings? If so, this will fail the Netlify build. Here’s why:

  • Node.js engines are restricted to v14.x only
  • Netlify uses .nvmrc to set the Build container Node.js version. In this case it’s LTS, which is now Node.js 16.x

The Build container is using a Node.js version that your package.json does not allow.

How to set your config

There are a few things you can do to fix this configuration conflict.

Upgrade to Redwood v0.38

Redwood v0.38 is compatible with Node.js v16.x.

Change your .nvmrc

For the example above, you would want to set the .nvmrc file to use Node.js v14. Update .nvmrc:

- lts/*
+ v14

Final Steps

To apply the changes, you’ll most likely need to Trigger a Deploy with the cache cleared.

Screen Shot 2021-10-27 at 6 53 13 PM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jtoarcommented, Jul 19, 2022

Netlify deploy has been quite stable since v1. Closing mainly due to staleness, and that things are so different now it’d be hard to diagnose whatever the original problem was.

Note that we could definitely still reduce the size of functions… see https://github.com/redwoodjs/redwood/issues/5160

0reactions
thedavidpricecommented, Nov 10, 2021

@doesnotexist any updates here or still stuck on function size blowing up? These things can be tough to diagnose and, frankly, we’ve been struggling with Netlify’s build the past few releases. My guess is you’ll be just fine deploying if you make the switch to Vercel.

Please keep me posted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting the Node version in Netlify to fix failing builds
If you want to know how to set the Node version in Netlify without the story, you can set it at Site settings...
Read more >
[Support Guide] Frequently encountered problems during builds
js — the Netlify build may fail due to the mixed case filename. The file system used in Netlify builds is case sensitive,...
Read more >
Incorrect Node version suddenly required by netlify plugin ...
Hey everyone, I am dealing with strange issue where a plugin netlify-plugin-fetch-feeds breaks the build process completely out of the blue.
Read more >
Build failing after upgrade to node 18 - Netlify Support Forums
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, ......
Read more >
Build troubleshooting tips - Netlify Docs
Find troubleshooting tips for failing builds, learn how to address certain build errors, and access additional support resources.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found