Updated to SDK 49 and build is failing because package requires node 18

I recently upgraded to SDK 49 and I am trying to get an Android build at the moment.

The issue is the build fails with this error

[stderr]

error @react-native/normalize-colors@0.73.1: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.18.1"

13
[stderr]
error Found incompatible module.
14
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
15
Error: Unknown error. See logs of the Install dependencies build phase for more information.

Reading on the web it says I can specify a node version in the eas.json file. This is mine

{
  "cli": {
    "version": ">= 3.15.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "node:": "18.16.0",
      "channel": "development"
    },
    "preview": {
      "distribution": "internal",
      "channel": "preview"
    },
    "production": {
      "channel": "production"
    }
  },
  "submit": {
    "production": {}
  }
}

However, when I try and build I get the error:

$ eas build -p android --profile development
eas.json is not valid.
- "build.development.node:" is not allowed
    Error: build command failed.
error Command failed with exit code 1.

How can I fix this please

Thank you
Erik

Hello,

Same here !

I build my app yesterday with success.
Today I made a fix, and now I got this same error.

No lib updated today.

Thank you for any help :slight_smile:

Hi @shoothill

That’s strange. I just tried this now:

    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "node": "18.16.0"
    },

and it did not complain about the validity of eas.json. What version of eas do you have? Maybe try upgrading it? I have this:

$ eas --version
eas-cli/5.3.0 linux-x64 node-v20.6.0

By the way, you can also do it as follows if you want to specify the Node version only once:

{
  "cli": {
    "version": ">= 3.15.0"
  },
  "build": {
    "base": {
      "node": "18.16.0"
    },
    "development": {
      "extends": "base",
      "developmentClient": true,
      "distribution": "internal",
      "channel": "development"
    },
    "preview": {
      "extends": "base",
      "distribution": "internal",
      "channel": "preview"
    },
    "production": {
      "extends": "base",
      "channel": "production"
    }
  },
  "submit": {
    "production": {}
  }
}

Hi @r.nething

Do you have your lock file (e.g. package-lock.json or yarn.lock) in .gitignore by any chance? It should not be in .gitignore.

If that’s not it, then I am not sure why you might suddenly be getting this error without upgrading anything.

I ran into this because of react-native-reanimated. Version 2.x throws this error for me. Try expo install react-native-reanimated

Basically the problem is that a library is using an incompatible version of @react-native/normalize-colors, so it might not be reanimated but that’s a pretty common lib.

You can try to find which lib it is by yarn why @react-native/normalize-colors or by grepping through your yarn.lock file.

See also Android and iOS build fails: error @react-native/normalize-colors@0.73 - #4 by brents

According to the linked issue they have fixed this in @react-native/normalize-colors version 0.73.2

1 Like

Thanks for your answer.

I think it is solved now, as we can see it here :

Yes, that’s what I meant when I said “According to the linked issue they have fixed this in @react-native/normalize-colors version 0.73.2”

1 Like

Thanks everyone. All seems to be working ok now.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.