The version of Mix appears to be incompatible with Webpack? Try either
npm install webpack@^4.0.0 --save-dev
or upgrade Mix dependency https://laravel-mix.com/docs/6.0/upgrade
npm install laravel-mix@next
And try re-running.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I just install a new laravel project ( laravel and PHP 8)
laravel new laravue
Then I install laravel/ui after the package installed I run
npm install && npm run dev
I got this error:
development
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js
[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.module.rules[10] has an unknown property 'loaders'. These properties are valid:
object { compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, loader?, mimetype?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, sideEffects?, test?, type?, use? }
-> A rule description with conditions and effects for modules.
npm ERR! code 2
npm ERR! path /Users/user/Documents/Sites/laravue
npm ERR! command failed
npm ERR! command sh -c cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js
The version of Mix appears to be incompatible with Webpack? Try either
npm install webpack@^4.0.0 --save-dev
or upgrade Mix dependency https://laravel-mix.com/docs/6.0/upgrade
npm install laravel-mix@next
And try re-running.
Please or to participate in this conversation.