`npm run watch`在Laravel 5.4中不起作用 [英] `npm run watch` not working in Laravel 5.4

查看:60
本文介绍了`npm run watch`在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆