简体   繁体   English

无法打开 React Native 项目

[英]Can't open React Native project

I have a problem with RN. RN有问题。 I'm a newbie in RN, but I know a little bit of React.我是 RN 的新手,但我对 React 有一点了解。

So I tried to clone and open this project: https://github.com/mapbox/store-locator-react-native/所以我尝试克隆并打开这个项目: https://github.com/mapbox/store-locator-react-native/

But I couldn't.但我做不到。 I tried putting expo and running the project on an Android emulator, but even after I tried installing and uninstalling multiple packages, I always get some error.我尝试放置 expo 并在 Android 模拟器上运行项目,但即使在我尝试安装和卸载多个包之后,我总是会遇到一些错误。 I also tried with npx react-native run-android but it doesn't work (in the folder with the project, not the base).我也尝试使用 npx react-native run-android 但它不起作用(在项目的文件夹中,而不是基础文件夹中)。

Could please someone tell me how to make this project work on my local machine and maybe even upgrade it to the newest RN?请有人告诉我如何使这个项目在我的本地机器上运行,甚至可以将它升级到最新的 RN? Thanks谢谢

you have to navigate to your project你必须导航到你的项目

follow the steps i am assuming your project on Desktop launch terminal and write按照我假设您的项目在桌面启动终端上的步骤并编写

cd Desktop/RNStoreLocatorExample 

if you have IOS platform如果你有 IOS 平台
do

npm install

cd ios 

then然后

pod init 
pod install 

cd ..

react-native run-ios

or if you have android write或者如果你有 android 写

 react-native run-android

Hope it will work希望它会奏效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM