Node.js version 10 reached End of Life (EOL) on April 30, 2021. AWS Lambda, the service behind Netlify Functions, will stop supporting serverless function deploys using Node.js 10 on July 30, 2021.
You will be impacted if you have explicitly set the
AWS_LAMBDA_JS_RUNTIME environment variable to
If you keep the environment variable set to
nodejs10.x and deploy any changes to your existing functions on or after July 30, 2021, your build will fail.
If you do not deploy any changes to your functions, they will continue to run; end of support does not impact function execution. However, they will be running on an unsupported runtime which is no longer maintained or patched.
You can upgrade your Node runtime and avoid build failures in two ways:
- Remove the
AWS_LAMBDA_JS_RUNTIMEenvironment variable altogether, in which case we will default to using Node 12
For many functions, upgrading from Node 10 will have no negative effects. For others, the upgraded version may cause bugs or other errors in your newly deployed functions. So it’s a good idea to test your functions first!
Here are a few methods you could use to test without risking errors in production:
Run your functions locally in the Netlify CLI using the
netlify devcommand. Whatever version of Node.js you’re running on your computer is the runtime your functions will use locally. You can use a tool like nvm or nvm-windows to manage multiple Node.js versions on your computer.
Test on Netlify by locking your deploys and updating the functions runtime. With your deploys locked, you can test your functions on any deploy without the risk of accidentally deploying a change to production. You can set
nodejs12.xor any other runtime supported by AWS Lambda. Then, trigger a branch deploy and test the functions in that deploy. If you need to deploy to production while you’re testing, you can set the runtime back to
nodejs10.xbefore unlocking deploys.
Test on Netlify by creating a new test site from your existing repo. This works a lot like the previous option, but with a bit less risk and possibly less hassle. If you want to use Node.js 12, you don’t even have to set the runtime, since new sites use version 12 by default. You can still set the runtime if you want to use a more specific version of
So you’ve tested your functions in a newer runtime, and one of them doesn’t work!
It’s time to start checking error messages and debugging. The problem will often be caused by one or more dependencies, so a useful strategy is to update dependencies related to your error messages, update your functions code as needed to work with the newer version of the dependency, and test again.
Here are a few resources you may find helpful:
- Release notes for Node.js v12.0.0
- Release notes for Node.js v14.0.0
- Third-party blog post comparing Node v10 vs. v14
Also, always remember the Netlify Forum is here for you! You can ask questions or post additional tips and references in this topic, or start a new topic if it seems significantly different.