facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.09k stars 24.19k forks source link

Running first init project Error React-rncore: Command PhaseScriptExecution failed with a nonzero exit code #39734

Open fachrinfl opened 11 months ago

fachrinfl commented 11 months ago

Description

I'm just trying to run a newly initialized React Native project.

React Native Version

0.72.5

Output of npx react-native info

System: OS: macOS 14.0 CPU: (8) arm64 Apple M2 Memory: 129.89 MB / 8.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.12.1 path: ~/.nvm/versions/node/v18.12.1/bin/node Yarn: Not Found npm: version: 8.19.2 path: ~/.nvm/versions/node/v18.12.1/bin/npm Watchman: version: 2023.09.18.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.13.0 path: /Users/fachrinfl/.rvm/gems/ruby-2.7.7/bin/pod SDKs: iOS SDK: Platforms:

Steps to reproduce

npx react-native init AwesomeProject xed -b ios Running via XCode

Snack, screenshot, or link to a repository

Screenshot 2023-10-01 at 16 53 46
github-actions[bot] commented 11 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
cortinico commented 11 months ago

We can't help you further with more logs sadly @fachrinfl

marcogravbrot commented 11 months ago

Exact same issue here, using Xcode 15 (public version not beta) on macOS Sonoma. Tried both on 0.72.5 and 0.72.4. Also on an M2 chip.

Building and running the app still works fine with "react-native start" and fastlane, but when trying to build through Xcode this error keeps occurring after the update to Sonoma


System:
  OS: macOS 14.0
  CPU: (8) arm64 Apple M2
  Memory: 60.28 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.5.1
    path: /opt/homebrew/bin/node
  Yarn: Not Found
  npm:
    version: 10.1.0
    path: /opt/homebrew/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.13.0
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.8
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /opt/homebrew/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.4
    wanted: 0.72.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
FawadMahmood commented 11 months ago

I am facing same issues.

marcogravbrot commented 11 months ago

Fixed this issue for now by deleting Xcode 15 public release and downloading Xcode 15 beta 8. (Also updated macOS to 14.1 developer beta but unsure if that had any effect)

FawadMahmood commented 11 months ago

@cortinico, here are some more logs:


Showing Recent Messages
Node found at: /usr/local/bin/node

internal/modules/cjs/loader.js:1131

      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);

      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/fawadmahmood/Documents/latest-mobile-fax/node_modules/wrap-ansi/index.js

require() of ES modules is not supported.

require() of /Users/fawadmahmood/Documents/latest-mobile-fax/node_modules/wrap-ansi/index.js from /Users/fawadmahmood/Documents/latest-mobile-fax/node_modules/cliui/build/index.cjs is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.

Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/fawadmahmood/Documents/latest-mobile-fax/node_modules/wrap-ansi/package.json.

    at new NodeError (internal/errors.js:322:7)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1131:13)

    at Module.load (internal/modules/cjs/loader.js:979:32)

    at Function.Module._load (internal/modules/cjs/loader.js:819:12)

    at Module.require (internal/modules/cjs/loader.js:1003:19)

    at require (internal/modules/cjs/helpers.js:107:18)

    at Object.<anonymous> (/Users/fawadmahmood/Documents/latest-mobile-fax/node_modules/cliui/build/index.cjs:293:14)

    at Module._compile (internal/modules/cjs/loader.js:1114:14)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)

    at Module.load (internal/modules/cjs/loader.js:979:32) {

  code: 'ERR_REQUIRE_ESM'

}
soutua commented 11 months ago

I encountered a similar issue on an existing project after I run brew upgrade on my mac, which updated Node version from 18.17.0 to 18.18.0. In the end the issue was that the ios/.xcode.env.local file that gets generated the first time you run pod install, had a hard coded path to the 18.17.0 Node version, which didn't exist anymore. So fixing that file fixed the build. This doesn't however explain why you would have this issue on a new project, but probably good idea to check what that file contains 🤔

fachrinfl commented 11 months ago

i cant still run the project @soutua after upgrading node version.

gomestai commented 11 months ago

Same error, fresh project, xcode 15, xcode 15 beta 8 both giving same error

gomestai commented 11 months ago

Solved. In my case, the problem occurred if the parent folder names contained whitespaces. Removing whitespaces in folder names fixed the problem

shaunsheeps commented 11 months ago

Same thing here. I solved my issue by removing a whitespace in one of the parent folders

ricodidan commented 10 months ago

Same with me, any update please?

Rajnish1211 commented 10 months ago

Same error with me (Mac version : 14.1 , Xcode : 15.0.1 and node : 18.18.0 )

Any Update ?

Rajnish1211 commented 10 months ago

Solved. In my case, the problem occurred if the parent folder names contained whitespaces. Removing whitespaces in folder names fixed the problem

Its also work for me https://www.positioniseverything.net/command-phasescriptexecution-failed-with-a-nonzero-exit-code/ Thanks @gomestai

DiorAbjalilov commented 10 months ago

Me too this error

gokul1099 commented 10 months ago

I am also facing the same issue. after running react-native run-ios it is showing PhaseScriptExecution failed with lots of error. If i scroll up to the top in the terminal I could see something like find: /Users/{user}/Library/Developer/Xcode/DerivedData/{projectname}-aaljqomuvoszdacrlntaoafplcyl/SourcePackages/artifacts: No such file or directory /bin/sh: : No such file or directory Command PhaseScriptExecution failed with a nonzero exit code

ricodidan commented 10 months ago

In my case just solved by

  1. Deleting package-lock.json
  2. Deleting yarn.lock
  3. Deleting node_modules & Pods from ios folder
  4. Installing node_modules again.
  5. Adding Pods again, ie. npx pod-install
  6. Then running project by - npx react-native run-ios

hopefully worked

DiorAbjalilov commented 10 months ago

Description

I'm just trying to run a newly initialized React Native project.

React Native Version

0.72.5

Output of npx react-native info

System: OS: macOS 14.0 CPU: (8) arm64 Apple M2 Memory: 129.89 MB / 8.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.12.1 path: ~/.nvm/versions/node/v18.12.1/bin/node Yarn: Not Found npm: version: 8.19.2 path: ~/.nvm/versions/node/v18.12.1/bin/npm Watchman: version: 2023.09.18.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.13.0 path: /Users/fachrinfl/.rvm/gems/ruby-2.7.7/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 23.0 - iOS 17.0 - macOS 14.0 - tvOS 17.0 - watchOS 10.0 Android SDK: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9971841 Xcode: version: 15.0/15A240d path: /usr/bin/xcodebuild Languages: Java: version: 11.0.19 path: /opt/homebrew/opt/openjdk@11/bin/javac Ruby: version: 2.7.7 path: /Users/fachrinfl/.rvm/rubies/ruby-2.7.7/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.5 wanted: 0.72.5 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false

Steps to reproduce

npx react-native init AwesomeProject xed -b ios Running via XCode

Snack, screenshot, or link to a repository

Screenshot 2023-10-01 at 16 53 46

me too has this error

DiorAbjalilov commented 10 months ago

Description

I'm just trying to run a newly initialized React Native project.

React Native Version

0.72.5

Output of npx react-native info

System: OS: macOS 14.0 CPU: (8) arm64 Apple M2 Memory: 129.89 MB / 8.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.12.1 path: ~/.nvm/versions/node/v18.12.1/bin/node Yarn: Not Found npm: version: 8.19.2 path: ~/.nvm/versions/node/v18.12.1/bin/npm Watchman: version: 2023.09.18.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.13.0 path: /Users/fachrinfl/.rvm/gems/ruby-2.7.7/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 23.0 - iOS 17.0 - macOS 14.0 - tvOS 17.0 - watchOS 10.0 Android SDK: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9971841 Xcode: version: 15.0/15A240d path: /usr/bin/xcodebuild Languages: Java: version: 11.0.19 path: /opt/homebrew/opt/openjdk@11/bin/javac Ruby: version: 2.7.7 path: /Users/fachrinfl/.rvm/rubies/ruby-2.7.7/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.5 wanted: 0.72.5 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false

Steps to reproduce

npx react-native init AwesomeProject xed -b ios Running via XCode

Snack, screenshot, or link to a repository

Screenshot 2023-10-01 at 16 53 46

solution. There should be no empty space in the names of folders managing the project. and worked for me

DiorAbjalilov commented 10 months ago

I am also facing the same issue. after running react-native run-ios it is showing PhaseScriptExecution failed with lots of error. If i scroll up to the top in the terminal I could see something like find: /Users/{user}/Library/Developer/Xcode/DerivedData/{projectname}-aaljqomuvoszdacrlntaoafplcyl/SourcePackages/artifacts: No such file or directory /bin/sh: : No such file or directory Command PhaseScriptExecution failed with a nonzero exit code

Thanks 👍

FedeRobledo commented 10 months ago

Same issue here with Xcode 15.0.1 on macOS Sonoma.

In my case i solved it setting the correct path to the nodejs version that my project needs, i don't know why but xcode was using another.

To do it i had to create the file .xcode.env.local inside my ios folder and set the next path NODE_BINARY="/opt/homebrew/Cellar/node@16/16.20.2/bin/node"

mykappevolve commented 9 months ago

facing the same issue on mac 13.6.1, xcode 15.0.1

Edison4mobile commented 9 months ago

same for me.

Katerlad commented 9 months ago

Removing folder with white spaces fixed the problem for me as well. Why in the world. Does anyone know why this may be the case? This means XCode cannot handle white space folders currently?

alextkd commented 9 months ago

Removing folder with white spaces fixed the problem for me as well. Why in the world. Does anyone know why this may be the case? This means XCode cannot handle white space folders currently?

I still have this problem and there are no white spaces in the name of the parent folder so it's not really that.

thuann-vn commented 9 months ago

Same issue here with Xcode 15.0.1 on macOS Sonoma.

In my case i solved it setting the correct path to the nodejs version that my project needs, i don't know why but xcode was using another.

To do it i had to create the file .xcode.env.local inside my ios folder and set the next path NODE_BINARY="/opt/homebrew/Cellar/node@16/16.20.2/bin/node"

It works for me

liquidvisual commented 9 months ago

For me it was an issue with Node 21 and openSSL (or lack thereof). Check out my comment here, hopefully it works for someone: https://github.com/facebook/react-native/issues/41617#issuecomment-1823930970

nikjoshi141 commented 9 months ago

I have M3 Pro Macbook Pro and the issue was due to whitespaces in the directory name. Make sure to remove whitespaces in the parent directories as well

izozo commented 9 months ago

Solved. In my case, the problem occurred if the parent folder names contained whitespaces. Removing whitespaces in folder names fixed the problem

thanks a lot!!!!!!

maribeiroleya commented 8 months ago

The same issue here.

React-native: 0.73 Macbook Mini M1 Xcode 15.01

efstathiosntonas commented 8 months ago

This commit fixed it for me: (rn 0.73.0)

https://github.com/facebook/react-native/commit/9f28616650a61ca298c2fc710b588445b8ceb94c

I was getting this back:

Command PhaseScriptExecution failed with a nonzero exit code

Node found at: /Users/stathis/.nvm/versions/node/v18.17.1/bin/node
+ DEST=/Users/stathis/Library/Developer/Xcode/DerivedData/xxxxxxxxxxj/Build/Products/Debug-iphoneos/xxxxxxxxx.app
+ [[ ! -n '' ]]
+ [[ Debug = *Debug* ]]
+ [[ ! iphoneos == *simulator ]]
+ for num in 0 1 2 3 4 5 6 7 8
++ ipconfig getifaddr en0
+ IP=
Command PhaseScriptExecution failed with a nonzero exit code

The IP= was empty so after running this on my terminal ipconfig getifaddr en0 it returned nothing while ipconfig getifaddr en1 returned my machine's IP address. After visiting react-native/scripts/react-native-xcode.sh on this repo I found out about the commit mentioned above that fixed it for me.

Worth mentioning that the build error was happening only when building on real device, on simulator the build has no issues.

shahzeb8285 commented 8 months ago

Solved. In my case, the problem occurred if the parent folder names contained whitespaces. Removing whitespaces in folder names fixed the problem

after wasting around 24 hours. it solved finally

Thanks

mzruiz commented 8 months ago

I encountered a similar issue on an existing project after I run brew upgrade on my mac, which updated Node version from 18.17.0 to 18.18.0. In the end the issue was that the ios/.xcode.env.local file that gets generated the first time you run pod install, had a hard coded path to the 18.17.0 Node version, which didn't exist anymore. So fixing that file fixed the build. This doesn't however explain why you would have this issue on a new project, but probably good idea to check what that file contains 🤔

For me, I had to delete the file and rerun pod install to 'fix' it.

Thanks for the help!

andres-dos-santos commented 8 months ago

@ricodidan not all heroes wear capes

jianxyou commented 8 months ago

Cellar

This works for me , after 24 hrs of finding solution : )

miteshdevg commented 8 months ago

i have solution Please check you project name existing (blank space ) Please remove it

mickaeldamatha commented 8 months ago

@gomestai You made my day

Gabriel-Ivan5795 commented 7 months ago

Hello. I have the same problem, no white spaces in the name of the projects, reinstalling the pods. All the steps added on this thread were tried, but the problem is still there.

I can't believe that this framework isn't working with simple steps related to the official documentation. Initiated a simple project and tried to run it...

MacBook Pro Apple M1 Mac os x: Version 14.0 (23A344) Xcode: Version 15.2 (15C500b) iOS real device: iOS 16.1.1, iPhone 12 Pro iOS simulator: iOS 17.2 Node: v21.5.0 React-Native: react-native-cli: 2.0.1

Later edit, I tried also with Node v18.19.0

Screenshot 2024-01-16 at 13 06 25 Screenshot 2024-01-16 at 13 06 46

Gabriel-Ivan5795 commented 7 months ago

Hello. I have the same problem, no white spaces in the name of the projects, reinstalling the pods. All the steps added on this thread were tried, but the problem is still there.

I can't believe that this framework isn't working with simple steps related to the official documentation. Initiated a simple project and tried to run it...

MacBook Pro Apple M1 Mac os x: Version 14.0 (23A344) Xcode: Version 15.2 (15C500b) iOS real device: iOS 16.1.1, iPhone 12 Pro iOS simulator: iOS 17.2 Node: v21.5.0 React-Native: react-native-cli: 2.0.1

Later edit, I tried also with Node v18.19.0

Screenshot 2024-01-16 at 13 06 25 Screenshot 2024-01-16 at 13 06 46

Somehow I tested on a Macbook with Intel configuration and there everything is working fine.

miteshdevg commented 7 months ago

Please change a name of your project folder

On Wed, Jan 17, 2024, 2:43 PM Ivan Gabriel @.***> wrote:

Hello. I have the same problem, no white spaces in the name of the projects, reinstalling the pods. All the steps added on this thread were tried, but the problem is still there.

I can't believe that this framework isn't working with simple steps related to the official documentation. Initiated a simple project and tried to run it...

MacBook Pro Apple M1 Mac os x: Version 14.0 (23A344) Xcode: Version 15.2 (15C500b) iOS real device: iOS 16.1.1, iPhone 12 Pro iOS simulator: iOS 17.2 Node: v21.5.0 React-Native: react-native-cli: 2.0.1

Later edit, I tried also with Node v18.19.0

[image: Screenshot 2024-01-16 at 13 06 25] https://private-user-images.githubusercontent.com/57225797/297024914-16755786-c3bd-4a0d-b757-9103834cc464.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDU0ODMwNTAsIm5iZiI6MTcwNTQ4Mjc1MCwicGF0aCI6Ii81NzIyNTc5Ny8yOTcwMjQ5MTQtMTY3NTU3ODYtYzNiZC00YTBkLWI3NTctOTEwMzgzNGNjNDY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAxMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMTE3VDA5MTIzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNkNGE4NmFlZjU0NWZjYTE1ZDEwYjc3OTBhODI1Zjg3ZTEzYjQ1N2UzZjAwNmEzY2Y0ZTE1MDBkMDY3MDk5ZTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zgW21ZI1SMY80MwR8jfDCWJ6-O-qVCnQh1_pAHaLpWc [image: Screenshot 2024-01-16 at 13 06 46] https://private-user-images.githubusercontent.com/57225797/297024924-bd844b07-f43e-47b7-b9b4-e1bef731d833.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDU0ODMwNTAsIm5iZiI6MTcwNTQ4Mjc1MCwicGF0aCI6Ii81NzIyNTc5Ny8yOTcwMjQ5MjQtYmQ4NDRiMDctZjQzZS00N2I3LWI5YjQtZTFiZWY3MzFkODMzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAxMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMTE3VDA5MTIzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFjODk0MDYxOTdhZGQyZmUwZmU1N2Y4YWUwYTVlMTkxOGZkYmFhMzRiODI5ZWQ5YWM0YWUwYWYzNjYxZmVjZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Z0BtECww_XLHHfpt4SCs2rk_54HzX2LbA_EadgrfmJ4

Somehow I tested on a Macbook with Intel configuration and there everything is working fine.

— Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/39734#issuecomment-1895392811, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5UB5UVYJDX6GIF2N2OAXLTYO6I5FAVCNFSM6AAAAAA5OGPJFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJVGM4TEOBRGE . You are receiving this because you commented.Message ID: @.***>

Gabriel-Ivan5795 commented 7 months ago

I think it was because I had a space in the root location of the project.

mshibinc commented 7 months ago

same issue i am suffering this problem last 10 days "React-rncore command phasescriptexecution failed with a nonzero exit code" system Mac m2 xcode version 15 react native version 0.72 note: properly working on Intel chipset mac

harisbaig100 commented 7 months ago

Always install node through homebrew, other wise it will give issues like this. brew install node

gavrilikhin-d commented 7 months ago

I see in logs that some command from the script uses cp with invalid option

cp: invalid option -- 'X'
Command PhaseScriptExecution failed with a nonzero exit code

This option is present in native cp (/bin/cp), so the solution would be to patch

--- a/node_modules/react-native/scripts/react_native_pods_utils/script_phases.sh
+++ b/node_modules/react-native/scripts/react_native_pods_utils/script_phases.sh
@@ -104,7 +104,7 @@
     mkdir -p "$RCT_SCRIPT_OUTPUT_DIR"

     # Copy all output to output_dir
-    cp -R -X "$TEMP_OUTPUT_DIR/." "$RCT_SCRIPT_OUTPUT_DIR" || exit 1
+    /bin/cp -R -X "$TEMP_OUTPUT_DIR/." "$RCT_SCRIPT_OUTPUT_DIR" || exit 1
     echo "$LIBRARY_NAME output has been written to $RCT_SCRIPT_OUTPUT_DIR:" >> "${SCRIPT_OUTPUT_FILE_0}" 2>&1
     ls -1 "$RCT_SCRIPT_OUTPUT_DIR" >> "${SCRIPT_OUTPUT_FILE_0}" 2>&1
 }
alexandcote commented 7 months ago

My issue was related to coreutils. I remove it from my PATH and the app compiled.

DucPhanDuy commented 7 months ago

Solved. In my case, the problem occurred if the parent folder names contained whitespaces. Removing whitespaces in folder names fixed the problem

God damnit. You saved my life

AhmedAyachi commented 7 months ago

To anyone facing the same problem or any problem related to this RN crap,

  1. open ios folder in xcode
  2. click on the top bar where your app name exists with ">" next to it
  3. pick React-rncore and run again now you'll get more details about the error, mine was just a Permission Denied error, if it's the case: #
  4. right-click on the project folder
  5. click Get-Info
  6. scroll to the bottom and at the bottom right click the "lock" icon
  7. set "everyone" to "Read & Write"
  8. click on the circle with dots in it at the bottom and then click "Apply to enclosed Items"
  9. re-run the ios app Hope it helps

and just a tip for anyone encountring issues with a project that magically stopped working, just try the update your packages to the latest versions (I know it's not always possible but ...) and start from there, latest versions are more likely to function than others.

parveen-bhatia commented 7 months ago

I faced same issue and found that cp -R -X "$TEMP_OUTPUT_DIR/." "$RCT_SCRIPT_OUTPUT_DIR" || exit 1 https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods_utils/script_phases.sh#L107 was failing due to cp: invalid option -- 'X'. I couldn't find upper case -X option in cp command from gnu docs and also couldn't find it in unix posix. So, this script needs to be updated to make it work for different cp commands from different platforms.

huzaifahazelGit commented 7 months ago

Description

I'm just trying to run a newly initialized React Native project.

React Native Version

0.72.5

Output of npx react-native info

System: OS: macOS 14.0 CPU: (8) arm64 Apple M2 Memory: 129.89 MB / 8.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.12.1 path: ~/.nvm/versions/node/v18.12.1/bin/node Yarn: Not Found npm: version: 8.19.2 path: ~/.nvm/versions/node/v18.12.1/bin/npm Watchman: version: 2023.09.18.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.13.0 path: /Users/fachrinfl/.rvm/gems/ruby-2.7.7/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 23.0 - iOS 17.0 - macOS 14.0 - tvOS 17.0 - watchOS 10.0 Android SDK: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9971841 Xcode: version: 15.0/15A240d path: /usr/bin/xcodebuild Languages: Java: version: 11.0.19 path: /opt/homebrew/opt/openjdk@11/bin/javac Ruby: version: 2.7.7 path: /Users/fachrinfl/.rvm/rubies/ruby-2.7.7/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.5 wanted: 0.72.5 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false

Steps to reproduce

npx react-native init AwesomeProject xed -b ios Running via XCode

Snack, screenshot, or link to a repository

Screenshot 2023-10-01 at 16 53 46

same error but no any found solution ,,,,kindly support me if any one to solve it

ApoIesh commented 6 months ago

try removing the currently installed Node version and download a different version of Node you could use NVM to manage different versions of Node if you already use it try another version

i solve this error by downgrade my version