본문 바로가기
IT&DEV - IT & 개발/Frontend

[ReactNative] npm run ios 실행시 Command PhaseScriptExecution failed 해결

by Hoft 2022. 4. 28.

 

오랜만에 다시 react-native 로 프로젝트를 만들어서

이것저것 테스트좀 해보려고 합니다.

 

하지만 react 프로젝트 생성 하고 앱 실행하는 부분에서 부터 에러가 나와 해결 한 방법을 공유합니다.

(사실 에러만 잘 읽어봐도 좋을 텐데 무조건 구글링 하는 습관이..)

 

 

# Stockmoa는 프로젝트 폴더명입니다.
➜  Stockmoa npm run ios
 
 

위와 같이 실행하니 " Command PhaseScriptExecution failed " 이라는 에러가 나왔습니다.

You need to run "nvm install default" to install it before using it. 요 문구를 보니

nvm default 설치 관련으로 보여집니다.

  export variant\=normal
    /bin/sh -c /Users/gamto/Library/Developer/Xcode/DerivedData/Stockmoa-ftrsdixrzlcmxxacgesomywgflmr/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00014D80.sh
N/A: version "default -> N/A" is not yet installed.

You need to run "nvm install default" to install it before using it.
Command PhaseScriptExecution failed with a nonzero exit code


objc[96755]: Class AppleTypeCRetimerRestoreInfoHelper is implemented in both /usr/lib/libauthinstall.dylib (0x1fe855eb0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1047b04f8). One of the two will be used. Which one is undefined.
objc[96755]: Class AppleTypeCRetimerFirmwareAggregateRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x1fe855f00) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1047b0548). One of the two will be used. Which one is undefined.
objc[96755]: Class AppleTypeCRetimerFirmwareRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x1fe855f50) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1047b0598). One of the two will be used. Which one is undefined.
objc[96755]: Class ATCRTRestoreInfoFTABFile is implemented in both /usr/lib/libauthinstall.dylib (0x1fe855fa0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1047b05e8). One of the two will be used. Which one is undefined.
objc[96755]: Class AppleTypeCRetimerFirmwareCopier is implemented in both /usr/lib/libauthinstall.dylib (0x1fe855ff0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1047b0638). One of the two will be used. Which one is undefined.
objc[96755]: Class ATCRTRestoreInfoFTABSubfile is implemented in both /usr/lib/libauthinstall.dylib (0x1fe856040) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1047b0688). One of the two will be used. Which one is undefined.
2022-04-28 10:22:33.207 xcodebuild[96755:902735] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-04-28 10:22:33.207 xcodebuild[96755:902735] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** BUILD FAILED **


The following build commands failed:
	PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/gamto/Library/Developer/Xcode/DerivedData/Stockmoa-ftrsdixrzlcmxxacgesomywgflmr/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00014D80.sh (in target 'FBReactNativeSpec' from project 'Pods')
(1 failure)

info Run CLI with --verbose flag for more details.
 

 

nvm install default 를 실행하니 기본 설정 버전이 없는게 문제로 나오네요

➜  Stockmoa nvm install default
Version 'default' not found - try `nvm ls-remote` to browse available versions.
➜  Stockmoa nvm install default
Version 'default' not found - try `nvm ls-remote` to browse available versions.
➜  Stockmoa nvm ls
 

 

음..뭐가있나 보니 설치된게 없습니다.

➜  Stockmoa nvm ls

->       system
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)
lts/* -> lts/gallium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.19.1 (-> N/A)
lts/gallium -> v16.15.0 (-> N/A)
 

node 를 설치하니 default 로 node v18.0.0 이 만들어 진걸 확인할 수 있습니다.

➜  Stockmoa nvm install node
Downloading and installing node v18.0.0...
Downloading https://nodejs.org/dist/v18.0.0/node-v18.0.0-darwin-arm64.tar.xz...
################################################################################################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v18.0.0 (npm v8.6.0)
Creating default alias: default -> node (-> v18.0.0)
 

 

다시 npm run ios 명령어를 실행하여 정상 작동하는 것으로 확인 완료!

➜  Stockmoa npm run ios
> Stockmoa@0.0.1 ios
> react-native run-ios

info Found Xcode workspace "Stockmoa.xcworkspace"
info Building (using "xcodebuild -workspace Stockmoa.xcworkspace -configuration Debug -scheme Stockmoa -destination id=B1BFF204-C2CF-4989-B89A-FDE9C2B2FC95")
success Successfully built the app
 

 

#​react #reactnative #frontend #react-native #mobile #hybridapp #app #nvm #run-ios

댓글