android - 无法启动 react-native start
问题描述
尝试运行“react-native start”命令时,我从终端收到以下消息。
Loading dependency graph...internal/fs/watchers.js:170
throw error;
Error: ENOSPC: no space left on device, watch '/home/junior/ReactNative/ToDoList/android/gradle'
at FSWatcher.start (internal/fs/watchers.js:164:26)
at Object.watch (fs.js:1232:11)
at NodeWatcher.watchdir (/home/junior/ReactNative/ToDoList/node_modules/sane/src/node_watcher.js:159:22)
at Walker.<anonymous> (/home/junior/ReactNative/ToDoList/node_modules/sane/src/common.js:109:31)
at Walker.emit (events.js:182:13)
at /home/junior/ReactNative/ToDoList/node_modules/walker/lib/walker.js:69:16
at go$readdir$cb (/home/junior/ReactNative/ToDoList/node_modules/graceful-fs/graceful-fs.js:162:14)
at FSReqWrap.oncomplete (fs.js:141:20)
解决方案
在 android 中,您需要先手动启动 Metro Bundler!
直接在终端启动 Metro Bundler
react-native start
现在运行
react-native run-android
或react-native run-ios
在另一个选项卡中
是的,如果您遇到类似的错误,Error: ENOSPC: no space left on device, watch '/home/junior/ReactNative/ToDoList/android/gradle' at FSWatcher.start (internal/fs/watchers.js:164:26) at Object.watch (fs.js:1232:11) at NodeWatcher.watchdir (/home/junior/ReactNative/ToDoList/node_modules/sane/src/node_watcher.js:159:22) at Walker. (/home/junior/ReactNative/ToDoList/node_modules/sane/src/common.js:109:31) at Walker.emit (events.js:182:13) at /home/junior/ReactNative/ToDoList/node_modules/walker/lib/walker.js:69:16 at go$readdir$cb (/home/junior/ReactNative/ToDoList/node_modules/graceful-fs/graceful-fs.js:162:14) at FSReqWrap.oncomplete (fs.js:141:20)
则需要删除当前的模拟器并创建带有附加空格的新模拟器,
如果您在终端中遇到任何问题,那么您也可以重置您的 npm 数据
清理缓存
rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/haste-*; rm -rf $TMPDIR/metro-*; watchman watch-del-all
推荐阅读
- mysql - 使用 MySQL 查询从 Joomla 中的文章中删除链接
- flutter - 可以mapEventToState同一个实例
- apache-kafka - 使用 Kafka 流中的 Session 窗口对记录进行排序并插入 MySQL 数据库
- python - 根据 len 和 int 对字符串数据进行排序
- python - Python:如何在嵌套列表中查找某些字符并返回索引
- google-cloud-platform - 如何在 bigquery 中不使用键连接多个表
- python - KivyMD MDTextField 不接受任何输入
- user-interface - 使用 GUI_DOWNLOAD 将标题行下载到 TXT
- android-studio - 我收到警告说:不是活动子类或别名
- elasticsearch - 向多个弹性搜索索引发送消息