简体   繁体   English

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

[英]events.js:183 throw er; // Unhandled 'error' event

I created a new React Project via the command npx create-react-app agent_mo project. 我通过命令npx create-react-app agent_mo项目创建了一个新的React项目。 It has been created but while starting it with npm start i am getting the following error 它已经创建但是在使用npm start时,我收到以下错误

在此输入图像描述

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. 这也将在重新启动后持续存在。

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

References: Node.js: what is ENOSPC error and how to solve? 参考文献: Node.js:什么是ENOSPC错误以及如何解决?

Listen uses inotify by default on Linux to monitor directories for changes. 默认情况下,Listen在Linux上使用inotify来监视目录以进行更改。 It's not uncommon to encounter a system limit on the number of files you can monitor. 在可监视的文件数量上遇到系统限制并不罕见。 For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192. 例如,Ubuntu Lucid的(64位)inotify限制设置为8192。

You can get your current inotify file watch limit by executing: 您可以通过执行以下命令获取当前的inotify文件监视限制:

$ cat /proc/sys/fs/inotify/max_user_watches

When this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly. 如果此限制不足以监视目录中的所有文件,则必须增加限制以使Listen正常工作。

You can set a new limit temporary with: 您可以使用以下方法设置临时新限制:

$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p

If you like to make your limit permanent, use: 如果您想永久限制,请使用:

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

You may also need to pay attention to the values of max_queued_events and max_user_instances if Listen keeps on complaining. 如果Listen继续抱怨,您可能还需要注意max_queued_events和max_user_instances的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 node.js 错误信息 events.js:183 throw er; // 未处理的“错误”事件 - node.js error message events.js:183 throw er; // Unhandled 'error' event events.js:183 throw er; //生成纱线时发生未处理的“错误”事件 - events.js:183 throw er; // Unhandled 'error' event when giving yarn build 无法修复-events.js:183 throw er; //未处理的“错误”事件 - Unable to fix - events.js:183 throw er; // Unhandled 'error' event events.js:183 抛出错误; // 未处理的“错误”事件 ^ nodeJS JWT - events.js:183 throw er; // Unhandled 'error' event ^ nodeJS JWT events.js:288 抛出 er; // 未处理的“错误”事件 - events.js:288 throw er; // Unhandled 'error' event events.js:160 throw er; //未处理的'错误'事件^ - events.js:160 throw er; // Unhandled 'error' event ^ events.js:167 throw er; //未处理的'错误'事件 - events.js:167 throw er; //Unhandled 'error' event Events.js:167 抛出 er; // 未处理的“错误”事件 - Events.js:167 throw er; // Unhandled ‘error’ event events.js:352 抛出错误; // 未处理的“错误”事件 - events.js:352 throw er; // Unhandled 'error' event 离子-events.js:160 throw er; //未处理的“错误”事件 - Ionic - events.js:160 throw er; // Unhandled 'error' event
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM