React Native iOS Build:Can't Find Node

React Native ios build : Can't find node

I found one
solution

First find your current node, in shell

which node

then copy your node url to

export NODE_BINARY=[your node path]
../node_modules/react-native/packager/react-native-xcode.sh to node_modules/react-native/scripts/react-native-xcode.sh

Sample Image

New RN project in M1 mbp built failed. Could not find node. Make sure it is in bash PATH or set the NODE_BINARY environment variable.

sudo ln -s $(which node) /usr/local/bin/node

It resolved.

i am having issues with react-native ios build - Expected a type error in one of Library

Try following way to resolve this issue

Go to Finder -> Applications

Right click on Xcode app and click on Get Info

You'll see this window

Sample Image

Make sure Open using Rosetta is checked. If now mark it checked and close.

Restart your Xcode, clean build folder and build again.

Hope it resolves the issue!

Setup of React Native using ndenv on OS X

This issue was effectively fixed when facebook/react-native#5518 landed. react-native-xcode.sh now respects a NODE_BINARY environment variable that tells it where to find node on the build system. Under your app's target, see Build Phases > Bundle React Native code and images and set the shell script code to:

export NODE_BINARY=$HOME/.ndenv/shims/node
../node_modules/react-native/packager/react-native-xcode.sh

If your node is in a different location, change the value of NODE_BINARY to suit your installation. Here's a screencap from Xcode 7.1 to aid navigation:

Set NODE_BINARY under "Bundle React Native code and images"

PhaseScriptExecution error in React Native app

I have figured out a solution, if you're using nvm make sure you don't have another globally installed version of Node/npm.

If you aren't sure whether or not you have a global version, go to your bash_profile/zshrc and comment the three nvm initialization lines (export NVM_DIR="$HOME/.nvm" [...]), then open a new terminal and do node --version, if it still finds something it means that you have a global version somewhere, and you can find its path with which node.

In my case I'm using Homebrew, and I had a global version of Node that I wasn't even aware coming from the yarn formula, I discovered it after running brew uses --installed node. I went ahead and uninstalled yarn using brew uninstall --force yarn, which automatically uninstalled its node/npm dependency, then uncommented the nvm initialization lines, and then I reinstalled yarn using nvm's npm with npm i -g yarn, and now everything works.



Related Topics



Leave a reply



Submit