Windows 10
Nodejs v14.17.0
npm 6.14.13
修改源,使用ali云:
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
安装插件:
安装插件
npm install -g react-native-cli
克隆代码到本地,首先install
npm install
使用USB连接手机,手机设置开发模式。运行命令安装:
npx react-native run-android
Q:
运行React Native Tools出现错误
Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class
A:
nodejs版本高,修改 ./node_modules/metro-config/src/defaults/blacklist.js
/node_modules[/\\]react[/\\]dist[/\\].*/,
改为
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
Q:
编译并运行时出现错误
Scanning folders for symlinks in C:\Users\wpw\workspace\eac-mobile\node_modules (26ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '11.0.5'.
A:
JDK必须用1.8版本
Q:
make sure your bundle is packaged correctly or you're running a packager server
A:
在项目目录运行:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle
- DYTT : 第三方电影天堂React Native客户端V2.0
使用 360看看 数据源