react-native
react-native copied to clipboard
Command PhaseScriptExecution failed with a nonzero exit cod In Apple m1 machine
Description
Hello Folks,
Creating new react native project in apple m1 machine in "0.67.1" version, and my iOS project always getting failed to run getting this error.
node:internal/fs/utils:343
throw err;
^
Error: ENOENT: no such file or directory, lstat 'Project/MobileCodeChallenge/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../Libraries/Vibration/NativeVibration.js'
at Object.lstatSync (node:fs:1504:3)
at /Users/pradeeppradeep/Documents/All Project/MobileCodeChallenge/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:82:10
at Array.forEach (<anonymous>)
at Object.<anonymous> (/Users/pradeeppradeep/Documents/All Project/MobileCodeChallenge/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:81:10)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:816:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
errno: -2,
syscall: 'lstat',
code: 'ENOENT',
path: 'Project/MobileCodeChallenge/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../Libraries/Vibration/NativeVibration.js'
}
Command PhaseScriptExecution failed with a nonzero exit code
Version
0.67.1
Output of npx react-native info
System: OS: macOS 11.4 CPU: (8) x64 Apple M1 Memory: 44.86 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.5.0 - /usr/local/bin/node Yarn: Not Found npm: 8.3.2 - /usr/local/bin/npm Watchman: 2021.06.07.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0 Android SDK: API Levels: 29, 30, 31 Build Tools: 28.0.3, 29.0.2, 30.0.2, 31.0.0 System Images: android-30 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.2 AI-202.7660.26.42.7486908 Xcode: 13.1/13A1030d - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.1 => 0.67.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
1 :- Create new react-native project with the help of npx react-native init AwesomeProject
2 :- Try to run this project in iOS by Xcode and getting this error.
Snack, code example, screenshot, or link to a repository
No response
same issue with mac mini m1 and macbook pro m1 Is there any solution ? react native 0.67.1 and 0.67.2 are not working as i am creating new project i am using xcode 13.2.1
@adil2166 I am still looking for help
bro i am also facing the same issue. you may check this link may be it helpfull to you to understand what actually is the problem https://www.jakubkaspar.dev/blog/ios-developers-and-apple-silicon-m1-early-experience
I am still looking for help, but mine in MacBook Pro 2020
I'm still looking for help but my device is MacBook Air 2020
I'm still looking for help but my device is MacBook Air 2020
same
same here. Still looking since couple of weeks
Got it fixed by running this:
ln -s $(which node) /usr/local/bin/node
Got it fixed by running this:
ln -s $(which node) /usr/local/bin/node
Hey @higorhenriquegs , Where we have to run this command ? Can you please describe it more ?
So this might be totally unrelated, but my problem was that I hade a project folder with a space in the name which appears to be the problem. Some change in react native seems to be unable to handle a path with a space in the directory name (Which should be considered bad practice anyway). Hope it can help someone
@Axenu thanks work for me
So this might be totally unrelated, but my problem was that I hade a project folder with a space in the name which appears to be the problem. Some change in react native seems to be unable to handle a path with a space in the directory name (Which should be considered bad practice anyway). Hope it can help someone
@Axenu , Yes that is the answer, Worked for me
My computer has an M1 chip,I tried everything. The most important changes are as follows: nvm unalias default nvm alias default node
So this might be totally unrelated, but my problem was that I hade a project folder with a space in the name which appears to be the problem. Some change in react native seems to be unable to handle a path with a space in the directory name (Which should be considered bad practice anyway). Hope it can help someone
yes this really works for me
Guys, still looking for a solution... I am using React Native version 0.68.2, XCode 14.1, macOS Ventura, and getting error with "Command PhaseScriptExecution failed with a nonzero..." in both of VSCode IDE and XCode
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/{user}/Library/Developer/Xcode/DerivedData/AwesomeProject-hdolcfrdyyicqohatccqupexbmzo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00014D80.sh (in target 'FBReactNativeSpec' from project 'Pods')
(1 failure)
@Axenu thanks work for me!
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.