MacOs
react-native run-android

出现了以下报错
Make sure you have the Android development environment
Error: spawnSync ./gradlew EACCES

具体:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1016 file(s) to forward-jetify. Using 6 workers...
info JS server already running.
info Installing the app...
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: spawnSync ./gradlew EACCES
    at Object.spawnSync (internal/child_process.js:1041:20)
    at spawnSync (child_process.js:607:24)
    at execFileSync (child_process.js:634:15)
    at runOnAllDevices (/Users/momo/Documents/PR/react-native-apps/demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
    at buildAndRun (/Users/momo/Documents/PR/react-native-apps/demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:179:41)
    at /Users/momo/Documents/PR/react-native-apps/demo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:133:12
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Command.handleAction (/Users/momo/Documents/PR/react-native-apps/demo/node_modules/@react-native-community/cli/build/index.js:182:9)

解决办法:
在项目目录下使用以下指令:

chmod 755 android/gradlew
 

the chmod command sets the permissions of files or directories.
https://www.computerhope.com/unix/uchmod.htm

Failed to save ‘index.jsx’: Insufficient permissions. Select ‘Retry as Sudo’ to retry as superuser. EACCES: permission denied 解决方法:授予权限 sudo chmod -R 777 . ## 为当前目录及子目录搜于读写权限 -R : 对目前目录下的所有文件与子目录进行相同的权限变更(即以递回的方式逐个变更) 其他参数: u 表示该文件的拥有者,g 表示与该文件的拥有者属于同一个群体(group)者,o 表示其他以外的人,a 表示这三者皆是。 + 表示增加权限 实现一个简单的从模拟器的SD卡中读取数据实现音乐的播放暂停和停止 关键代码如下: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getWindow().setFlags(WindowManager.Lay npm install -g fixmynode 您是否经常遇到这个烦人的错误? npm ERR! Error: EACCES, open '/Users/YOUR_USERNAME/.npm/-/all/.cache.json' npm ERR! { [Error: EACCES, open '/Users/YOUR_USERNAME/.npm/-/all/.cache.json'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/Users/YOUR_USERNAME/.npm/-/all/.cache.json' } npm ERR! npm ERR! Please try running this command aga 运行sudo npm install -g webpack@4.35.2 安装指定版本的webpack出现如下错误: gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/mac-pro/.nvm/versions/node/v10.16.0/lib/node_modules/webpack/node_modules/fsevents/build’ gyp ERR! System Darwin 19.3.0 gyp ERR! command “/Users/mac-pro/ 一般来说,报 Error: spawn *** ENOENT 错误的原因可总结为:A.  spawn方法参数不正确:child_process.spawn(command[, args][, options])@command:要执行的命令@args:参数列表(可选)@options:配置对象(可选)spawn方法使用给定的command命令来产生一个子进程,args为命令行参数,如果省略,则默认... 查阅了很多文档都无法解决,于是自己后面慢慢尝试了一下,认真一步一步观察安装的提示,直到看到最后一句提示:  Should we run `npm install` for you after the project has been created? (recommended) npm 于是这次我选择了no,自己手动insta