webpack - Browsersync Laravel mix, Error: watch ENOSPC throw er; 未处理的“错误”事件
问题描述
当我npm run watch-poll
在 Laravel 中使用 browsersync 功能运行时:
mix.browserSync('https://vuravel.local')
我收到了这个奇怪的错误。我不知道如何解决这个问题。有任何想法吗?
我在 Ubuntu 上使用 Google Chrome 作为浏览器运行 apache 服务器。
[Browsersync] Access URLs:
---------------------------------------
Local: https://localhost:3000
External: https://192.168.1.244:3000
---------------------------------------
UI: http://localhost:3001
UI External: http://localhost:3001
---------------------------------------
[Browsersync] Watching files...
events.js:183
throw er; // Unhandled 'error' event
^
Error: watch /path/to/root/***.php ENOSPC
at _errnoException (util.js:1022:11)
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
解决方案
ENOSPC 是“没有可用空间错误”。
您需要做的是通过在终端中运行以下命令来增加可以观看的最大文件数量:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
推荐阅读
- mysql - 选择查询中的 Laravel 雄辩的 json
- message-queue - 消息队列 *like* 技术
- sharing - 将带有 Angular 的 Nativescript 的 Web 和移动代码共享迁移到版本 8
- sql - 如何根据特定类型对表中的行值求和?
- swiftui - List swiftUI中的单选按钮
- gitlab - 我们可以将具有多个元素的 gitlab 变量传递给 shell 脚本吗
- c - 当元素在头尾之间时,在基于平面数组的双链表中搜索
- flutter - Flutter:扩展覆盖 ConstrainedBox
- node.js - 如何在表单数据中传递双工流?
- c# - 在 IIS Express 中调试无头 ASP.NET Core 应用程序/禁用延迟启动