Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
304 views
in Technique[技术] by (71.8m points)

node.js - Node.js:什么是ENOSPC错误以及如何解决?(Node.js: what is ENOSPC error and how to solve?)

I have a problem with Node.js and uploading files to server.

(我在使用Node.js并将文件上传到服务器时遇到问题。)

For uploading files to server I use this plugin .

(为了将文件上传到服务器,我使用了这个插件 。)

When starting file upload to the server, Node.js process crashed and show error:

(开始将文件上传到服务器时,Node.js进程崩溃并显示错误:)

Error: ENOSPC.

(错误:ENOSPC。)

The server code doesn't run.

(服务器代码未运行。)

$ 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
  ask by Giffo translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Run the below command to avoid ENOSPC:

(运行以下命令以避免使用ENOSPC:)

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

For Arch Linux add this line to /etc/sysctl.d/99-sysctl.conf :

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

fs.inotify.max_user_watches=524288

Then execute:

(然后执行:)

sysctl --system

This will also persist across reboots.

(这也将在重新启动后持续存在。)

Technical Details Source

(技术细节来源)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...