我按照這個人的教程 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
我搜索了很多網站,試圖做我看到的一切,但我沒有任何作業。
請幫忙
uj5u.com熱心網友回復:
檢查你的 package.json 腳本:
"android": "react-native run-android",
"ios": "react-native run-ios",
并嘗試運行npx react-native run-ios
或yarn ios
uj5u.com熱心網友回復:
嘗試這個
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
}
將其添加到package.json
檔案中以防萬一。添加運行后npx react-native run-ios
uj5u.com熱心網友回復:
通常我們可以用 xcode 打開專案并運行。它將自動在本地啟動 Metro 服務器。
我的建議是用 xcode 打開你的專案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/507546.html