在iOS模拟器上运行react-native应用程序

问题描述 投票:0回答:1

所以我试图在iPhone 11-13.2.2模拟器上运行一个简单的react-native应用程序。

我输入npm run ios,但我又回来了。

** BUILD FAILED **


The following build commands failed:
        CompileC /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/build/confusion/Build/Intermediates.noindex/confusion.build/Debug-iphonesimulator/confusion.build/Objects-normal/x86_64/AppDelegate.o /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/confusion/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
        CompileC /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/build/confusion/Build/Intermediates.noindex/confusion.build/Debug-iphonesimulator/confusion.build/Objects-normal/x86_64/main.o /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/confusion/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ ios: `react-native run-ios`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ ios script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/theodosiostziomakas/.npm/_logs/2019-11-16T12_38_06_754Z-debug.log

我使用了npm install,但仍然没有。如何解决该错误?

谢谢,Theo。

javascript ios react-native
1个回答
0
投票

或者,您可以从工作空间文件运行,有时在ios中从npm运行不会给您确切的错误。您必须在工作区中运行以下文件,然后选择模拟器/ iphone,最后启动项目。

工作空间的路径:-ProjectFolder / ios / projectname.xcworkspace

© www.soinside.com 2019 - 2024. All rights reserved.