events.js:183 throw er; //未处理的“错误”事件

Abh*_*ami 5 node.js npm reactjs

我通过命令npx create-react-app agent_mo项目创建了一个新的React Project 。它已创建,但是在启动npm start时出现以下错误

在此处输入图片说明

Ash*_*iya 5

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

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Run Code Online (Sandbox Code Playgroud)

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

fs.inotify.max_user_watches=524288
Run Code Online (Sandbox Code Playgroud)

然后执行:

sysctl --system
Run Code Online (Sandbox Code Playgroud)

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

https://github.com/guard/listen/wiki/Increeasing-the-amount-of-inotify-watchers#the-technical-details

参考:Node.js:什么是ENOSPC错误以及如何解决?