我在尝试运行“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)
First screenshot displays emulator screen when I run "$react-native run-android" cmd
Second pic is screenshot when I reloaded the app by double pressing R
最佳答案
In android some time you need to first Start Metro Bundler manually!
Start Metro Bundler directly in terminal
react-native 启动
Now run
react-native run-android
orreact-native run-ios
in another tab
是的,如果您收到类似 Error: ENOSPC: no space left on device 的错误,请在 FSWatcher.start (internal/fs/watchers. js:164:26) 在 Object.watch (fs.js:1232:11) 在 NodeWatcher.watchdir (/home/junior/ReactNative/ToDoList/node_modules/sane/src/node_watcher.js:159:22) 在 Walker。 (/home/junior/ReactNative/ToDoList/node_modules/sane/src/common.js:109:31) 在 Walker.emit (events.js:182:13) 在/home/junior/ReactNative/ToDoList/node_modules/walker/lib/walker.js:69:16 在 go$readdir$cb (/home/junior/ReactNative/ToDoList/node_modules/graceful-fs/graceful-fs.js:162:14) 在 FSReqWrap.oncomplete (fs.js :141:20)
那么您需要删除当前的模拟器并创建一个带有额外空格的新模拟器,
如果您在终端中遇到任何错误,那么您也可以重置您的 npm 数据
Clean cache
rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/haste-*; rm -rf $TMPDIR/metro-*;守望者 watch-del-all
关于android - 无法启动 react-native start,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53331354/