我创建了一个新的本机项目
react-native init navigationApp--version 0.59.8
但是有构建问题...当我尝试运行(react-native run-android
)
控制台停留步骤:app:installDebug
,在npm
部分有一些错误。
我尝试了他们的步骤;
1.rm -rf node_modules package-lock.json
2。npm install
react-native@0.55.2 babel-preset-react-native@4.0.0
3。npm install
4.react-native run-android
λreact-native run-android
扫描文件夹中的C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp\node_modules (55ms)
中的符号链接
JS服务器已在运行。
在设备上构建和安装应用程序(cd android && gradlew.bat installDebug)...
启动Gradle守护进程(后续构建会更快)
<===========-> 97%EXECUT¦NG [7m 40s]
空闲 闲 闲 闲 闲 :app:installDebug 闲 空闲
λ npm start
> navigationApp@0.0.1 start C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp
> node node_modules/react-native/local-cli/cli.js start
Scanning folders for symlinks in C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp\node_modules (49ms)
┌───────────────────────────────────────────────────────────────────────────
───┐
│
│
│ Running Metro Bundler on port 8081.
│
│
│
│ Keep Metro running while developing on any JS projects. Feel free to
│
│ close this tab and run your own Metro instance if you prefer.
│
│
│
│ https://github.com/facebook/react-native
│
│
│
└───────────────────────────────────────────────────────────────────────────
───┘
Looking for JS files in
C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp
Metro Bundler ready.
Loading dependency graph, done.
ERROR EPERM: operation not permitted, lstat 'C:\Users\MONSTER\Desktop\project\react-navigation\navigationApp\android\app\build\intermediates\blame\res\debug\multi-v2'
npm ERR! code ELIFECYCLE
npm ERR! errno 11
npm ERR! navigationApp@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 11
npm ERR!
npm ERR! Failed at the navigationApp@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MONSTER\AppData\Roaming\npm-cache\_logs\2019-07-31T07_51_31_477Z-debug.log
答案 0 :(得分:0)
您必须按照以下说明清理项目
npm start -- --reset-cache
react-native run-android
此外,您可以清除项目android gradlew
文件,
cd/android
./gradlew clean