Laravel-mix: Stuck at `Please run Mix again`. Not showing what dependencies are required.

Created on 15 Feb 2018  路  5Comments  路  Source: JeffreyWay/laravel-mix

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',
    ]
});

Most helpful comment

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.

All 5 comments

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 馃檪

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nezaboravi picture nezaboravi  路  3Comments

mstralka picture mstralka  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

rderimay picture rderimay  路  3Comments

Bomavi picture Bomavi  路  3Comments