I tried running npm run watch and npm run prod. also tried reloading terminal. both saying:
npm run watch
> @ watch /Applications/AMPPS/www/pecp
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
Additional dependencies must be installed. This will only take a moment.
Finished. Please run Mix again.
Versions:
npm -v && node -v
5.6.0
v9.5.0
"laravel-mix": "^2.0"
Webpack.mix.js
let mix = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'js')
.sass('resources/assets/sass/app.scss', 'css')
.browserSync({
proxy: process.env.APP_URL,
files: [
'public/assets/css/**/*.css',
'public/assets/js/bundle.js',
'app/**/*.php',
'resources/views/**/*.php',
]
});
When you run npm run watch again does it ask same questions again
Yes. Even when i restart the terminal.
...
Additional dependencies must be installed. This will only take a moment.
Finished. Please run Mix again.
But i think this is related to browser sync, when i remove that line on webpack.mix.js, everything works normally again.
Update: I found out, Browsersync should be run before js/sass tasks.
let mix = require('laravel-mix');
mix.browserSync({
proxy: process.env.APP_URL,
files: [
'public/assets/css/**/*.css',
'public/assets/js/bundle.js',
'app/**/*.php',
'resources/views/**/*.php',
]
})
.js('resources/assets/js/app.js', 'js')
.sass('resources/assets/sass/app.scss', 'css');
Closing this now. Thanks @ankurk91 btw.
Mine was fixed by running npm run dev, that runs my laravel ie compiler mix
In my guess when you run two npm commands with && for example npm install && npm run dev/prod as the npm run dev/prod sits in the second place it will not run completely - I also don't know the technical reason behind 馃槄 - but as I experienced couple times already I can tell that when I tried to execute the npm run dev/prod one more time after that, it works perfectly!.
In conclusion, I assume "Please run Mix again" means that it just kindly asks you to run the npm run dev/prod command again 馃檪
Most helpful comment
Update: I found out, Browsersync should be run before js/sass tasks.
Closing this now. Thanks @ankurk91 btw.