【问题标题】:UnhandledPromiseRejectionWarning: Error: ENOSPC: no space left on device, watch <project directory>UnhandledPromiseRejectionWarning: E​​rror: ENOSPC: no space left on device, watch <project directory>
【发布时间】:2019-01-30 14:15:32
【问题描述】:

我创建了新的React Native 项目并尝试在android 模拟器上运行它,但是当我编写commane 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

【问题讨论】:

    标签: android react-native node-modules


    【解决方案1】:

    要解决 ENOSPC 问题,请在 Ubuntu 上运行以下命令

    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
    
    sysctl --system
    

    对于 /etc/sysctl.d/99-sysctl.conf 文件中的 Arch Linux 更新

    fs.inotify.max_user_watches=524288
    

    运行后

    sysctl --system
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-05
      • 1970-01-01
      • 2016-11-28
      • 1970-01-01
      • 2019-10-16
      • 2020-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多