`npm run watch`在Laravel 5.4中不起作用 [英] `npm run watch` not working in Laravel 5.4
问题描述
使用Laravel 5.4和Mix,当我运行npm run watch
时,它会编译所有内容,并且看起来它正在等待更改,但是当我对任何资产文件进行更改时,它似乎都无法检测到任何东西.还有其他人在5.4中有此问题或有解决方案吗?
Using Laravel 5.4 and Mix, when I run npm run watch
it compiles everything once and looks like it is waiting for changes, but when I make changes to any of my asset files it doesn't seem to detect anything. Is anyone else having this issue in 5.4 or have a solution?
推荐答案
该解决方案由Jeffrey Way在Laracasts上提供.
The solution was provided by Jeffrey Way over at Laracasts.
尝试将--watch-poll标志添加到您的package.json
脚本中.或者只是尝试:
Try adding the --watch-poll flag to your package.json
script. Or just try:
node_modules/.bin/webpack --watch --watch-poll --config=node_modules/laravel-mix/setup/webpack.config.js
这篇关于`npm run watch`在Laravel 5.4中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!