Environment variable not able to reflect while build (NODE_VERSION: 14.18.1)

Hi Team,

My site “tbo-site.netlify.app” was working fine from a long time with Node Version v14.18.1, but from last one week, its build process stop working.

We noticed that Netlify auto upgrade the Node version to v16.13.0, which is leading this issue.
Please check the attachment also please check the our build history. You will see a lot of failed builds.

Please check the build 617fe1687910540008cef7cf, you will see Node version 16x and build errors. Our GatsBy site plugins are not compatible with new version of Node. So we need node 14x LTS version.

We have tried all the ways that are mentioned in your document, but its not reflecting while build. Build always run with node version 16x.

Could you please look into this issue on priority as we are loosing the business, as we are not able to publish our new products.

Thanks!

hi there, sorry to hear you are having trouble.

I wonder if explicitly setting a specific node version could be helpful here. You can find more information on how to do so here:

let us know if this is helpful for you.

Thanks @perry for your reply.

The link that you shared, we have already tried both ways that mentioned in this doc, but none of them working.

  1. Add NODE_VERSION as environment variable in Environment variables under the Build & deploy section. We set it to NODE_VERSION: 14.18.1, but not worked

  2. Created .node-version file in base directory with value 14, but not worked

Could you please give sample example to set these values.
Please update.

Thanks!

Hi @allan.perrottet

Here is an example of the environment variable via Netlify UI


(Note: v possibly not required.)

If you have a netlify.toml in your git repository you can set it variables using file based configuration also, such as with [build.environment]

[build.environment]
  NODE_VERSION = "14.18.1"

Thanks @coelmay for quick reply.

Yes, we have tried both ways to do this. Please check the attachments.

  1. Added version in .node-version & netlify.toml files, not working.

  2. Added NODE_VERSION in Environment variables

  3. Build still running with node version 16.13.0. You can check the build process id 6180cea0250b530007489c97 and it failed.

I note in the screenshot of your log (nicer to have text rather than images with logs) a line which says

Attempting node version 'lts/*' from .nvmrc

which suggests you may have an .nvmrc file in your repository that is overriding all the other settings.

I can only see public logs that people explicitly link to (I’m not a Netlify employee.)

2 Likes

Thanks @coelmay

Yes I got .nvmrc file in root directory. We have removed this file and now build start working with our old version.

Thanks & appreciate for your help :slight_smile:

1 Like