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

后端 未结 16 2418
爱一瞬间的悲伤
爱一瞬间的悲伤 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:29

    If you're using VS Code then it'll should unable to watch in large workspace error.

    "Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)
    

    It indicates that the VS Code file watcher is running out of handles because the workspace is large and contains many files. The current limit can be viewed by running:

    cat /proc/sys/fs/inotify/max_user_watches
    

    The limit can be increased to its maximum by editing /etc/sysctl.conf and adding this line to the end of the file:

    fs.inotify.max_user_watches=524288
    

    The new value can then be loaded in by running sudo sysctl -p.

    Note: 524288 is the max value to watch the files. Though you can watch any no of files but is also recommended to watch upto that limit only.

提交回复
热议问题