不确定问题是否与laravel-mix有关,但我遇到了Browsersync包的问题。这是我的mix.js:
mix.js('resources/assets/js/app.js', 'public/js')
.browserSync({proxy: 'localhost:8000'})
.sass('resources/assets/sass/app.scss', 'public/css');
当我运行npm run watch-poll
时(watch
没有收到更改,因此watch-poll
see here)我在控制台上收到以下错误:< / p>
[Browsersync] Watching files...
events.js:160
throw er; // Unhandled 'error' event
^
Error: watch resources/views/auth/passwords ENOSPC
at exports._errnoException (util.js:1020:11)
at FSWatcher.start (fs.js:1443:19)
at Object.fs.watch (fs.js:1470:11)
at createFsWatchInstance (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleDir (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:407:19)
at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:460:16)
at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/tanmay/.npm/_logs/2017-08-07T07_02_31_677Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch-poll: `npm run watch -- --watch-poll`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch-poll script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/tanmay/.npm/_logs/2017-08-07T07_02_31_725Z-debug.log
我在:Ubuntu 16.04.3(不是VM)。运行:Nodejs v6.11.2,NPM v5.3.0
当我从mix.js注释掉.browserSync()
来电时:
mix.js('resources/assets/js/app.js', 'public/js')
// .browserSync({proxy: 'localhost:8000'})
.sass('resources/assets/sass/app.scss', 'public/css');
然而,错误不再存在。我该如何解决这个问题?请随时询问任何其他必要信息。
这是我的package.json文件
更新:此错误不会发生在新的laravel项目中。为了获得与新项目相同的结果,我就这样做了:
我删除了节点模块:rm -rf node_modules
我删除了package-lock.json文件:rm package-lock.json
我重新运行:npm install
,npm run dev
,{{1} }
结果:仍然是同样的错误:(
答案 0 :(得分:0)
这可能是由于已经在端口4040上运行的另一个任务。
您可以尝试killall -9 node
来源/更多详情:https://github.com/parse-community/parse-dashboard/issues/401#issuecomment-224007436
答案 1 :(得分:0)
我怀疑这是显示的同一问题&amp;使用Gulp Error: watch ENOSPC
的工作解决方案试试这个:为什么会出现这个问题?数量有限制 可以在系统中观看的文件。我们必须增加这一点 数。以下命令可用于增加此数字。
$ echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p