laravel-mix: npm run watch not working

  • Laravel Mix Version: 0.8.7
  • Node Version (v6.9.5):
  • NPM Version (4.3.0):
  • OS: Ubuntu 16.04

Description:

After running npm run watch or npm run watch-poll I get the message: DONE Compiled successfully in 11019ms. Next, I change js or css files, but recompiling is not happening. But npm run dev or npm run production are working fine. What’s wrong?

webpack.mix.js:

const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
   .js('resources/assets/js/pages.js', 'public/js')
   .js('resources/assets/js/srext.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .combine([
       'resources/library/**/css/*.css'
   ], 'public/css/all.css')
   .js('resources/library/ext/js/notjs.js', 'public/js/all.js')
   .version();

Steps To Reproduce:

npm run watch or npm run watch-poll

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15

Most upvoted comments

sudo sysctl fs.inotify.max_user_watches=900000000

Guys, JeffreyWay linked helped alot. this is my previouse script object in packages.json

` “watch”: “cross-env NODE_ENV=development webpack --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js”,

change that to the following

"watch": "cross-env NODE_ENV=development webpack --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",

if you notice I’ve added " --watch-poll " after --watch