[英]React Native setup Mac M1 (Air)
我按照这个人的教程https://youtu.be/MJEcookWYUI?t=686
视频命令后出现错误
admin@MacBook-Air:~/Demo$ npm run ios
npm ERR! missing script: ios
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2022-09-12T22_06_04_217Z-debug.log
我搜索了很多网站,试图做我看到的一切,但我没有任何效果。
请帮忙
尝试这个
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
}
将此添加到package.json
文件中,以防它不存在。 添加后运行npx react-native run-ios
检查您的 package.json 脚本:
"android": "react-native run-android",
"ios": "react-native run-ios",
并尝试npx react-native run-ios
或yarn ios
运行
通常我们可以用 xcode 打开项目并运行。 它将自动在本地启动 Metro 服务器。
我的建议是用 xcode 打开你的项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.