React native error - react-native-xcode.sh: line 45: reaction-native: command not found The command / bin / sh failed with exit code 127

I get this error when trying to create any (new or old) project. My node is on version 4.2.1, and response-native is on version 0.1.7. I looked at other people with the same problem, so I updated the reaction to the latest version, but I still can not create any project through xcode.

+5
source share
3 answers

To resolve this problem, use the following steps:

  • Use node version v4.2.1
  • cd in [your application] / node_modules / react-native / packager
  • $ sh. / packager.sh (for some reason this works fine)
  • Go to Xcode and go to the Build Phases tab. Remove the last item in the list (the one that runs the script). This way you are left with the target dependencies, compile the sources, link the binaries to the libraries and copy the Bundle resources.

Now click build in Xcode. Since the shell script is no longer part of the Xcode build procedure, it should not fail. And if you have a reaction to your own client server running in another terminal window, everything should work fine.

+1
source

If you use RN 0.46 or higher:

There is a break in changing Facebook: the location of the script has been changed, more details here

I was able to solve this error:

  • Opening a project in Xcode
  • Go to Build Phases > Bundle React Native code and images
  • Change export NODE_BINARY=node ../node_modules/react-native/packager/react-native-xcode.sh to export NODE_BINARY=node ../node_modules/react-native/scripts/react-native-xcode.sh

Note that now packager scripts , where this file is actually located in the latest version of RN

enter image description here

+34
source

I added source ~/.bash_profile to the top of my [project_name] /node_modules/react-native/packager/react-native-xcode.sh file and it works.

See https://github.com/facebook/react-native/issues/3948

0
source

Source: https://habr.com/ru/post/1235693/


All Articles