Node.js:ENOSPC 错误是什么以及如何解决? [英] Node.js: what is ENOSPC error and how to solve?

查看:32
本文介绍了Node.js:ENOSPC 错误是什么以及如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Node.js 并将文件上传到服务器时遇到问题.为了将文件上传到服务器,我使用了这个 插件.启动文件上传到服务器时,Node.js 进程崩溃并显示错误:

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 crashed and show error:

错误:ENOSPC.

服务器代码没有运行.

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.9G  4.1G  3.5G  55% /
udev            288M  8.0K  288M   1% /dev
tmpfs           119M  168K  118M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            296M     0  296M   0% /run/shm
/dev/xvdf       9.9G  3.0G  6.5G  32% /vol
overflow        1.0M  1.0M     0 100% /tmp

推荐答案

运行以下命令避免 ENOSPC:

Run the below command to avoid ENOSPC:

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

<小时>

对于 Arch Linux,将此行添加到 /etc/sysctl.d/99-sysctl.conf:

fs.inotify.max_user_watches=524288

然后执行:

sysctl --system

这也将在重新启动后持续存在.技术细节来源

This will also persist across reboots. Technical Details Source

这篇关于Node.js:ENOSPC 错误是什么以及如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆