我创建了一个新的React Native
项目,并试图在android模拟器上运行它,但是当我写命令react-native start
时,它显示了以下错误。
Loading dependency graph...(node:9088) UnhandledPromiseRejectionWarning: Error: ENOSPC: no space left on device, watch '<project path>'
at FSWatcher.start (internal/fs/watchers.js:161:26)
at Object.watch (fs.js:1218:11)
at NodeWatcher.watchdir (<project path>/node_modules/sane/src/node_watcher.js:175:20)
at new NodeWatcher (<project path>/node_modules/sane/src/node_watcher.js:45:8)
at createWatcher (<project path>/node_modules/jest-haste-map/build/index.js:762:23)
at Array.map (<anonymous>)
at HasteMap._watch (<project path>/node_modules/jest-haste-map/build/index.js:912:44)
有人可以帮助我解决这个问题吗?我用相同的设置创建了2个项目,一个工作正常,但另一个却出现这种错误。
react: 16.4.1
react-native:0.56.0
OS:ubuntu 16.04
答案 0 :(得分:1)
要解决ENOSPC问题,请在Ubuntu上运行以下命令
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
sysctl --system
对于Arch Linux,请更新/etc/sysctl.d/99-sysctl.conf文件中的行
fs.inotify.max_user_watches=524288
此运行后
sysctl --system