Node.js: what is ENOSPC error and how to solve?

后端 未结 16 2255
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 08:52

I have a problem with Node.js and uploading files to server. For uploading files to server I use this plugin. When starting file upload to the server, Node.js process crashe

相关标签:
16条回答
  • 2020-11-22 09:20

    A simple way that solve my problem was:

    npm cache clear
    

    npm or a process controlled by it is watching too many files. Updating max_user_watches on the build node can fix it forever. For debian put the following on terminal:

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

    If you want know how Increase the amount of inotify watchers only click on link.

    0 讨论(0)
  • 2020-11-22 09:22

    Can't take credit for this, but @grenade pointed out that npm dedupe will fix the cause (too many files) and not the symptom.

    Source: Grunt watch error - Waiting…Fatal error: watch ENOSPC.

    0 讨论(0)
  • 2020-11-22 09:22

    If you encounter this error during trying to run ember server command please rm -rf tmp directory. Then run ember s again. It helped me.

    0 讨论(0)
  • 2020-11-22 09:23

    In my case, on linux, sudoing fixed the problem.

    Example:

    sudo gulp dev
    
    0 讨论(0)
  • 2020-11-22 09:27

    It indicates that the VS Code file watcher is running out of handles because the workspace is large and contains many files. The max limit of watches has been reacherd, you can viewed the limit by running:

    cat /proc/sys/fs/inotify/max_user_watches
    

    run below code resolve this issue:

    fs.inotify.max_user_watches=524288
    
    0 讨论(0)
  • 2020-11-22 09:29

    Rebooting the machine solved the problem for me. I first tried wiping /tmp/ but node was still complaining.

    0 讨论(0)
提交回复
热议问题