I tried a lot of solutions nothing works for me except removing nvm

rm -rf ~/.nvm


Selecting a node version helped in my case: nvm use x.x.x.

I had this issue when starting the build with yarn - and was able to build the app only by using xcode or react-native run-ios.


So, I had the following error in the console when trying to run ios:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:

  • react-native-flipper (to unlink run: "react-native unlink react-native-flipper") [...]

I fixed it by tweaking my react-native.config.js like below and react-native run-ios started worked again

module.exports = {
  dependencies: {
    'react-native-flipper': {
      platforms: {
        ios: null, // Disable autolinking on iOS


I was installing TheCodingMachine React Native boilerplate 3.2.5 link and I got a similar error.

Decision. Updated the React Native version

//react-native": "0.66.4" ->  "react-native": "0.67.3"

cd ios && rm -rf Pods && pod install

And an nvm update can also help.


Applying the commit that removes the script with patch-package fixed this issue for a dev on our team who was stuck with this issue.

The contents of our patch is simply

diff --git a/node_modules/react-native/scripts/ b/node_modules/react-native/scripts/
deleted file mode 100755
index 5d6d2c4..0000000
--- a/node_modules/react-native/scripts/
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
-# This source code is licensed under the MIT license found in the
-# LICENSE file in the root directory of this source tree.
-set -e
-# remove global prefix if it's already set
-# the running shell process will choose a node binary and a global package directory breaks version managers
-unset PREFIX
-# Support Homebrew on M1
-if [[ -d $HOMEBREW_M1_BIN && ! $PATH =~ $HOMEBREW_M1_BIN ]]; then
-# Define NVM_DIR and source the setup script
-[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
-# Source nvm with '--no-use' and then `nvm use` to respect .nvmrc
-# See:
-if [[ -s "$HOME/.nvm/" ]]; then
-  # shellcheck source=/dev/null
-  . "$HOME/.nvm/" --no-use
-  nvm use 2> /dev/null || nvm use default
-elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/" ]]; then
-  # shellcheck source=/dev/null
-  . "$(brew --prefix nvm)/" --no-use
-  nvm use 2> /dev/null || nvm use default
-# Set up the nodenv node version manager if present
-if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then
-  eval "$("$HOME/.nodenv/bin/nodenv" init -)"
-elif [[ -x "$(command -v brew)" && -x "$(brew --prefix nodenv)/bin/nodenv" ]]; then
-  eval "$("$(brew --prefix nodenv)/bin/nodenv" init -)"
-# Set up the ndenv of anyenv if preset
-if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then
-  export PATH=${HOME}/.anyenv/bin:${PATH}
-  if [[ "$(anyenv envs | grep -c ndenv )" -eq 1 ]]; then
-    eval "$(anyenv init -)"
-  fi
-# Set up asdf-vm if present
-if [[ -f "$HOME/.asdf/" ]]; then
-  # shellcheck source=/dev/null
-  . "$HOME/.asdf/"
-elif [[ -x "$(command -v brew)" && -f "$(brew --prefix asdf)/" ]]; then
-  # shellcheck source=/dev/null
-  . "$(brew --prefix asdf)/"
diff --git a/node_modules/react-native/scripts/ b/node_modules/react-native/scripts/
index 3ef9a71..304a5dc 100755
--- a/node_modules/react-native/scripts/
+++ b/node_modules/react-native/scripts/
@@ -79,9 +79,7 @@ if [[ $DEV != true && ! -f "$ENTRY_FILE" ]]; then
   exit 2
-# Find path to Node
-# shellcheck source=/dev/null
-source "$REACT_NATIVE_DIR/scripts/"
+NODE_BINARY="$(command -v node)"
 # check and assign NODE_BINARY env
 # shellcheck source=/dev/null
diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb
index 1b8a078..d65c9ca 100644
--- a/node_modules/react-native/scripts/react_native_pods.rb
+++ b/node_modules/react-native/scripts/react_native_pods.rb
@@ -289,8 +289,6 @@ else
 find_node () {
-  source "$RN_DIR/scripts/"
   NODE_BINARY="${NODE_BINARY:-$(command -v node || true)}"
   if [ -z "$NODE_BINARY" ]; then
     echo "error: Could not find node. Make sure it is in bash PATH or set the NODE_BINARY environment variable." >> "${SCRIPT_OUTPUT_FILE_0}" 2>&1


Add below line in a pod file 1) use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })

  1. delete pod folder and lock.

  2. pod install

  3. run the app from Xcode and later from vscode.


For Final Run Mac 1 Silicon 0.65 (any version)

Npx react-native init newproject

Then change the pod file

Go to

Cd iOS

Open pod file


platform :ios, '12.1'

  post_install do |installer|
        installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] =  "arm64"

Pod File

And bridge header by adding the new swift file and after addition of bridge header please delete the swift file otherwise swift file may generate error.

For Creating the Swift File.

Go to project nitin2 -> Nitin2 (sub project) and right click on it Click New File Select swift file -> next Then select the nitin2 directory in the iOS folder Leave the file name same Click checkbox nitin2 in the target Click create Now the it will ask to create the bridging header.h Yes create the file And now go to

Go to project nitin2 -> Nitin2 (sub project) See the file.swift and delete it.

Now go to Xcode -> target Nitin2 -> build setting In ARCHITECTURES CLICK EXCLUDED ARCHITECTURES AND ADD THE arm64


Now Remove the build folder from Xcode product menu

Now do the things through terminal

Cd go to iOS directory

pod cache clean --all  

yarn cache clean  

rm -rf ~/Library/Developer/Xcode/DerivedData/*

open nitin2.xcworkspace

rm -rf Pods Podfile.lock 

pod deintegrate && pod setup && pod install

code /Users/nitin/D1/www/projects/nitin2/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/

Add export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin

Then run the iOS

npx react-native run-ios 


Copy all the script in xcode print and debug it in your shell. Using set -x to debug in shell. Normally you will find the actual bug.

PhasescriptExecution: strong text if ~/.nvmrc exists, but nvm is not a cmd in you shell.


If you do want to keep with nvm, you can comment the code from node-modules/react-native/scripts/ related to search the node version and add after it like:

export PATH="/Users/myMacUser/.nvm/versions/node/v16.13.0/bin/:$PATH"

in my case i commented these lines:

# # Support Homebrew on M1
# HOMEBREW_M1_BIN=/opt/homebrew/bin
# if [[ -d $HOMEBREW_M1_BIN && ! $PATH =~ $HOMEBREW_M1_BIN ]]; then
#   export PATH="$HOMEBREW_M1_BIN:$PATH"
# fi

# # Define NVM_DIR and source the setup script
# [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"

# if [[ -s "$HOME/.nvm/" ]]; then
#   # shellcheck source=/dev/null
#   . "$HOME/.nvm/"
# elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/" ]]; then
#   # shellcheck source=/dev/null
#   . "$(brew --prefix nvm)/"
# fi

on Xcode Build Phases I set statically the node version too on Bundle React Native code and images

set -e

export NODE_BINARY=/Users/myMacUser/.nvm/versions/node/v16.13.0/bin/node

myMacUser is your user

v16.13.0 is the node version I am using, you can set the one you want.


I have a lot of trouble trying to build an App, just to realize that my node installation isn't "normal". So, to make this work, I just linked the node to the usr/local/bin folder.

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

Running on a Mac M1.


If you are using nvm with an intel based Mac ln -s $(which node) /usr/local/bin should take care of the issue.



For me, this worked as I didn't have time to wait for answers (Not recommended method but if nothing else is working can go for this):

I uninstalled npm, node, and react-native and upon installing them again everything is working.


I followed

After two days of trying i found the solution in deleting spaces in the path where your project lives and run. But in order for this to work properly follow these steps:

  • If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues (i.e. npm uninstall -g react-native-cli)
  • Move the project folder in a path with no spaces (i.e. ~/sub folder name/ReactNativeApp won't work till you have spaces in the path, so move in a path like ~/folder/ReactNativeApp)
  • Then cd into the project folder and upgrade react native to the latest version with npx react-native upgrade and resolve conflicts if any
  • After upgrading remove the node_modules folder and the yarn.lock from the root and the podfile.lock and Pods folder from ios subfolder
  • Then cd back to the root and run yarn install && npx pod-install

Now run again your app in Xcode or your IDE and it works

Crazy and absurd that a space in the path-name could cause this issue

Thanks giuseppealbrizio!

I think my core fix came from running npx pod-install which update my Pod.lock checksum.


  • React-Native: 0.64.2
  • iOS Emulator: 14.4
  • XCode: 12.5

On a brand new npx react-native init project


  1. Build Settings -> Build Active Architecture Only -> Debug -> Yes
  2. Add "arm64" in "Excluded Architectures" in build settings of both project and pods project, to run the app in simulator. Remove it while making build on device or archiving the app.


If you use nvm make sure that you don't have separate node installed globally.

Check this answer for more


I got past this by removing nvm and reinstalling afterwards. I also removed the check lines from my .zshrc

rm -rf ~/.nvm


I think your problem come from this line.

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99.

This warning means that you are trying to deploy on a version that is not supported by Xcode anymore.

Your react native package seems to not be up to date because it init your project with the wrong target.

Use 'npx react-native init ProjectName' to fix this problem. This command will execute react-native with the latest version online.

You can fix your project target by using this command from this post.

When you run react-native run-ios, react-native will try to deploy with the target in his config file, but on Xcode the problem is bypassed by the config in Xcode.


in my case, just run rm -rf ./Pods && pod install, and then build your app npx react-native run-ios


Thank you @Neil Hasen for the detailed explanation. Instead of uninstalling nvm because I use it in a number of projects, I simply commented out the code in ./node_modules that referenced the nvm.

if [[ -s "$HOME/.nvm/" ]]; then
    # shellcheck source=/dev/null
    . "$HOME/.nvm/"
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/" ]];      
    # shellcheck source=/dev/null
    . "$(brew --prefix nvm)/"   

The code can be found in node_modules/react-native/scripts/


The problem is because you have the project created inside a folder with a name that contains spaces, example: "React Native", rename your folder to "React-Native" and rerun the command npx react-native run-ios, that should be enough.

When you execute the command npx react-native run-ios it may create a new folder for you, you must delete the folder that was generated automatically and keep the folder that you renamed at the beginning as "React-Native". Once the automatically generated folder is deleted, run the command again: npx react-native run-ios

Remember: Do not create React Native projects inside folders that contain spaces between their names.

I hope to be helpful. Greetings.


I'm running my React Native app on m1 and my problem was with nvm which I set the default alias. I just run the nvm unalias default and it solved the issue.


I've been trying to solve this problem for days on MacOS M1 Big Sur. Nobody else's exact solution worked for me, so I'm going to describe how I came to my solution. Hopefully the process will help someone else figure out what works for them.

Everything (for me) needed to be running in Rosetta. Make sure Xcode is running in Rosetta. Make sure your Terminal is running in Rosetta. Make sure pod, yarn, npm, whatever you use, is running the x86 version, not the arm64 version. Make sure you ran yarn install/npm install/pod install with the x86 versions, not the arm64 versions.

To clarify arm64 vs. x86, you should ask your Terminal which yarn, which node, which npm, which pod to see the full path to those executables. This is complicated by there being so many ways to install node. I installed node through Homebrew, so my paths below reflect that.

For Homebrew on x86 (running in Rosetta Terminal), you should see:

$ which node
$ which yarn
$ which npm

Note the /usr/local/homebrew/bin. If you're not running in Rosetta Terminal, you'll see /opt/homebrew/bin. If you're seeing /opt/homebrew/bin anywhere, it's a red flag.

Another trap, easy to fall into... I was in Rosetta Terminal with the x86 node, but I realized that my global yarn installation was /opt/homebrew/bin/yarn. I was doing yarn install with arm64 yarn, which can cause problems with your dependencies.

Seriously, run all the commands above as a sanity check.

Things still weren't working. Same error in Xcode, a mysterious PhaseScriptExecution error on some********.sh. I opened up Script-********.sh, and saw that it called node_modules/react-native/scripts/, which in turned called another script led me to my problem. I put "echo" debugging statements all over it, and then I ran directly to see what was printed. Sure enough, this one caught something:

elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/" ]]; then
  echo "AM I GOING CRAZY?"
  . "$(brew --prefix nvm)/"

I have no idea what this script is doing, but back in my Terminal I ran echo $(brew --prefix nvm), which output /usr/local/homebrew/opt/nvm. Clearly, the react-native script is making some kind of decision based on its finding nvm.

I don't want nvm to be part of my equation at all; I'm not using it. So in both Rosetta Terminal and Terminal, I brew uninstall nvm.

Back in XCode, clean build folder, rebuild, and it works.

This is not going to be a satisfying answer for many, as these exact steps will likely not work for you. No one else's exact steps worked for me.

After reading dozens of solutions to this problem, it seems that most of them have causes that are node version/path/architecture related. I hope this answer gives you some tools to investigate that yourself. Namely:

  1. Make sure which node/yarn/npm is pointing to the correct x86 path.
  2. Make sure you installed your node_modules with the correct x86 executable.
  3. Debug your node_modules/react-native/scripts/ to see if you're tripping up on any extraneous node things in your environment.

Related Query

More Query from same tag