[錯(cuò)誤1]搭建項(xiàng)目完成后,start報(bào)錯(cuò)
image.png
根據(jù)圖片顯示大磺,正則錯(cuò)誤抡句,
解決辦法:
修改項(xiàng)目內(nèi)文件: \node_modules\metro-config\src\defaults\blacklist.js
var sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
改為
var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
[錯(cuò)誤2]
報(bào)錯(cuò)圖示:
image.png
原因:未安裝react-redux
解決:
npm install --save react-redux
[錯(cuò)誤3]
報(bào)錯(cuò)圖示:
image.png
原因:未連接服務(wù)器
解決:確認(rèn)自己的服務(wù)器是否啟動(dòng)
確認(rèn)方法:
http://localhost:8081/index.android.bundle?platform=android
開啟:
react-native start
或
npm start