# Using Node 14.x Doesn't Work

**URL:** <https://answers.netlify.com/t/using-node-14-x-doesnt-work/40260>\
**Category:** Support\
**Tags:** lambda-functions, create-react-app, netlify-newbie, deployment\
**Created:** [July 2, 2021, 5:53pm UTC](https://answers.netlify.com/t/using-node-14-x-doesnt-work/40260 "2021-07-02T17:53:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![olliecee](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/olliecee/32/51401_2.png) [@olliecee](https://answers.netlify.com/u/olliecee)\
**Post date:** [July 2, 2021, 5:53pm UTC](https://answers.netlify.com/t/using-node-14-x-doesnt-work/40260/1 "2021-07-02T17:53:12Z")

</div>

My site deployed successfully and I’m using Netlify Functions using JavaScript.

I have 1 specific function that errors with `"errorType":"Runtime.UserCodeSyntaxError"` that uses JavaScript’s new [optional chaining (?)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining), all the other ones are fine. Someone figured that their code was running on Node 14 while Netlify ran it in Node 12 in this [thread](https://answers.netlify.com/t/function-gives-502-error-when-deployed-to-netlify-but-executes-fine-locally/30078), but instead of upgrading his Node version he just downgraded his code to support Node 12 syntax.

For me though, I want to do the opposite, I want to upgrade Netlify’s Node version to 14 instead of using 12.  
Locally it doesn’t error and I’m using the versions:  
Node: `v14.17.0`  
Yarn: `1.22.10`

On [Netlify’s build image](https://github.com/netlify/build-image#available-images) selection I am using `Ubuntu Xenial 16.04 (default)` which uses `v12.x` by default.

To select your own Node version you can do many things like `.nvmrc`, `NODE_VERSION`, etc., I choose both the options I mentioned above with the same version I am using `v14.17.0`. According to Netlify, they use the [Amazon Lambdas which has support for Node 14.x](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).

My build was published successfully had this to say:

```auto
2:17:02 AM: Attempting node version 'v14.17.0' from .nvmrc
2:17:02 AM: Downloading and installing node v14.17.0...
2:17:02 AM: Downloading https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz...
2:17:03 AM: Computing checksum with sha256sum
2:17:03 AM: Checksums matched!
2:17:06 AM: Now using node v14.17.0 (npm v6.14.13)

```

So we are in fact forcing Netlify Node to use the same Node version I am using locally. The project also uses the correct version of Yarn. Now that everything is identical, environment wise, build-step wise, code-wise… I am still getting the `Runtime.UserCodeSyntaxError` on that 1 specific function that uses this code syntax:

```auto
const test = obj?.obj2?.obj3?.test

```

I know Node 14.x supports this new style and 12.x doesn’t but even my Netlify deploy logs tell me its using Node 14.x.

What is wrong here?

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [July 2, 2021, 6:22pm UTC](https://answers.netlify.com/t/using-node-14-x-doesnt-work/40260/2 "2021-07-02T18:22:00Z")

</div>

If you’re using optional chaining in Netlify Functions, the runtime is not the same as what you specify in Node build settings. You need to specify AWS Runtime like mentioned here: [Build functions | Netlify Docs](https://docs.netlify.com/functions/build-with-javascript/#runtime-settings)
