Mix was not set up correctly. Please ensure you import or require laravel-mix in your mix config / Laravel Mix v6.0.39

611 views Asked by At

On a Laravel application, while trying to run:

npm run dev

I get the following message:

npm run dev
dev
npm run development
development
mix
Mix was not set up correctly. Please ensure you import or require laravel-mix in your mix config.
99% done plugins BuildOutputPlugin

node version: v14.18.2
npm version: 8.2.0

No js and css output to public/js and public/css is being produced and I get no other error.

I removed and readded node-modules folder several times..

Any ideas how can I solve this issue pls?

1

There are 1 answers

0
Marcello Pato On

For me, the solution for this error is to insert this line at the top of the webapck.mix.js file:

let mix = require('laravel-mix');