react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Command PhaseScriptExecution failed with a nonzero exit cod In Apple m1 machine

Open pankajinfowind opened this issue 3 years ago • 17 comments

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

pankajinfowind avatar Jan 25 '22 13:01 pankajinfowind

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 avatar Feb 02 '22 12:02 adil2166

@adil2166 I am still looking for help

pankajinfowind avatar Feb 03 '22 05:02 pankajinfowind

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

adil2166 avatar Feb 03 '22 12:02 adil2166

I am still looking for help, but mine in MacBook Pro 2020

manurung9 avatar Mar 07 '22 09:03 manurung9

I'm still looking for help but my device is MacBook Air 2020

aaaasif avatar Mar 07 '22 09:03 aaaasif

I'm still looking for help but my device is MacBook Air 2020

amirmohammadshamss avatar Mar 10 '22 20:03 amirmohammadshamss

same

vinaydrevankar avatar Mar 14 '22 15:03 vinaydrevankar

same here. Still looking since couple of weeks

sohaibjaved44 avatar Mar 17 '22 05:03 sohaibjaved44

Got it fixed by running this: ln -s $(which node) /usr/local/bin/node

higorhenriquegs avatar Mar 23 '22 20:03 higorhenriquegs

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 ?

pankajinfowind avatar Mar 24 '22 05:03 pankajinfowind

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 avatar Apr 21 '22 20:04 Axenu

@Axenu thanks work for me

Ramzankhan123 avatar May 30 '22 06:05 Ramzankhan123

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

pankajinfowind avatar Jun 16 '22 05:06 pankajinfowind

My computer has an M1 chip,I tried everything. The most important changes are as follows: nvm unalias default nvm alias default node

bozaigao avatar Jun 17 '22 01:06 bozaigao

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

Ridwan226 avatar Sep 28 '22 19:09 Ridwan226

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)

bdmostafa avatar Dec 05 '22 10:12 bdmostafa

@Axenu thanks work for me!

brightspread avatar Jul 07 '23 03:07 brightspread

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.

github-actions[bot] avatar Mar 29 '24 05:03 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Apr 15 '24 05:04 github-actions[bot]