Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native needs Node.js >= 18. You're currently on version [closed]

I am trying to create a react native project on my Mac. I've tried it before using laravel and it worked, but this time I am having issues with node.js. Not sure why, but I can't find the solution despite going through several articles.. I have an idea that there might be something with alias' created, but I can't remember as it is years ago since I last touched it,

As the image says, then react required node.js v18 or higher, but I am running v.21. The error however says I am running on version 14, which doesn't make sense to me..

[enter image description here1

like image 208
bngaard Avatar asked Sep 08 '26 06:09

bngaard


2 Answers

I went through the same problem. I did the following:

Uninstall NVM:

rm -rf $NVM_DIR ~/.npm ~/.bower

Install NVM again (check the latest version here):

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

Install the node version that you want to use:

nvm install 20

Use it:

nvm use 20

Profit! :)

===============================================================

Extra:

In order to make it work with the project itself, what I did was:

Go to your android folder inside your project:

cd android/

Stop gradlew demon:

./gradlew --stop

Go up to your root project folder:

cd ..

Run react native's start command:

npx react-native start

In another tab, run the emulator (check if your node version is correct by running node --version):

npx react-native run-android --list-devices

Select your emulator and voilá!

like image 74
Juanma Avatar answered Sep 09 '26 22:09

Juanma


try to run node --version with out listing through nvm

or try to uninstall nvm and node then download and install latest version of node without nvm and try again

this could be an issue with nvm

like image 31
saqib Avatar answered Sep 09 '26 22:09

saqib



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!