[英]What do these errors mean in React-Native in my react-native project and how do I fix them?
Error: spawn ./gradlew EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
0 info it worked if it ends with ok 0 信息 如果它以 ok 结尾它就有效
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'android' ] 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'android' ]
2 info using npm@6.14.5 2 使用 npm@6.14.5 的信息
3 info using node@v12.17.0 3 使用 node@v12.17.0 的信息
4 verbose run-script [ 'preandroid', 'android', 'postandroid' ] 4 冗长的运行脚本 [ 'preandroid', 'android', 'postandroid' ]
5 info lifecycle @~preandroid: @ 5 信息生命周期@~preandroid:@
6 info lifecycle @~android: @ 6 信息生命周期@~android:@
7 verbose lifecycle @~android: unsafe-perm in lifecycle true 7 冗长的生命周期@~android:生命周期中的不安全烫发为真
8 verbose lifecycle @~android: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/jonas/Desktop/ProjectTastebuds2/TasteBuds/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin 8 详细的生命周期@~android: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/jonas/Desktop/ProjectTastebuds2/TasteBuds/node_modules/.bin:/usr /local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
9 verbose lifecycle @~android: CWD: /Users/jonas/Desktop/ProjectTastebuds2/TasteBuds 9 详细生命周期 @~android: CWD: /Users/jonas/Desktop/ProjectTastebuds2/TasteBuds
10 silly lifecycle @~android: Args: [ '-c', 'react-native run-android' ] 10 个愚蠢的生命周期 @~android: Args: [ '-c', 'react-native run-android' ]
11 silly lifecycle @~android: Returned: code: 1 signal: null 11 愚蠢的生命周期@~android:返回:代码:1信号:null
12 info lifecycle @~android: Failed to exec android script 12 信息生命周期@~android:无法执行 android 脚本
13 verbose stack Error: @ android: react-native run-android
13 详细堆栈错误:@ android: react-native run-android
13 verbose stack Exit status 1 13 详细堆栈退出状态 1
13 verbose stack at EventEmitter. EventEmitter 的 13 详细堆栈。 (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20) EventEmitter.emit (events.js:315:20) 处的 13 个详细堆栈
13 verbose stack at ChildProcess. 13 ChildProcess 的详细堆栈。 (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20) ChildProcess.emit 的 13 个详细堆栈(events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16) maybeClose 处的 13 个详细堆栈(内部/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) Process.ChildProcess._handle.onexit 处的 13 详细堆栈(内部/child_process.js:286:5)
14 verbose pkgid @ 14 详细 pkgid @
15 verbose cwd /Users/jonas/Desktop/ProjectTastebuds2/TasteBuds 15 verbose cwd /Users/jonas/Desktop/ProjectTastebuds2/TasteBuds
16 verbose Darwin 19.6.0 16 详细达尔文 19.6.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "android" 17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "android"
18 verbose node v12.17.0 18 详细节点 v12.17.0
19 verbose npm v6.14.5 19 详细 npm v6.14.5
20 error code ELIFECYCLE 20 错误代码 ELIFECYCLE
21 error errno 1 21 错误 errno 1
22 error @ android: react-native run-android
22 error @ android: react-native run-android
22 error Exit status 1 22 错误退出状态 1
23 error Failed at the @ android script. 23 错误 @android 脚本失败。
23 error This is probably not a problem with npm. There is likely additional logging output above. 23 错误 这可能不是 npm 的问题。上面可能有其他日志记录 output。
24 verbose exit [ 1, true ] 24 详细退出 [1, true]
Run cd android &&./gradlew clean运行 cd android &&./gradlew clean
chmod +x gradlew chmod +x gradlew
It will work它会工作
cd android;
chmod +x gradlew;
./gradlew clean && cd ..;
It worked for me this way.它以这种方式对我有用。
If you are using Linux / Ubantu then you need give folder permission.如果您使用的是 Linux / Ubantu,那么您需要授予文件夹权限。 so you just need to type the command on your root Directory of project folder: sudo chmod -R 777 folder_name所以你只需要在项目文件夹的根目录中键入命令:sudo chmod -R 777 folder_name
eg:kishan@kishan-ideacentre-588S-0554iKL:~/Workspace/HundredAcer$ sudo chmod -R 777 android例如:kishan@kishan-ideacentre-588S-0554iKL:~/Workspace/HundredAcer$ sudo chmod -R 777 android
Then copy file named local properties from AndroidStudioProject/Your AppName/ then paste it to your projectName/Android/然后从 AndroidStudioProject/Your AppName/ 复制名为 local properties 的文件,然后将其粘贴到您的 projectName/Android/
you are done..!你完成了..!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.