node -v): v12.18.4npm -v): 7.0.2Npm 7 has highlighted a few peer dependency issue:
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/webpack
npm WARN peer webpack@"^4.27.0 || ^5.0.0" from [email protected]
npm WARN node_modules/css-loader
npm WARN dev css-loader@"^5.0.0" from the root project
npm WARN 5 more (laravel-mix, vue-loader, babel-loader, css-loader, file-loader)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer webpack@"^4.0.0" from [email protected]
npm WARN node_modules/friendly-errors-webpack-plugin
npm WARN friendly-errors-webpack-plugin@"2.0.0-beta.2" from [email protected]
npm WARN node_modules/laravel-mix
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/webpack
npm WARN peer webpack@"^4.27.0 || ^5.0.0" from [email protected]
npm WARN node_modules/css-loader
npm WARN dev css-loader@"^5.0.0" from the root project
npm WARN 5 more (laravel-mix, vue-loader, babel-loader, css-loader, file-loader)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer webpack@"^4.0.0" from [email protected]
npm WARN node_modules/webpack-dev-middleware
npm WARN webpack-dev-middleware@"^3.7.2" from [email protected]
npm WARN node_modules/webpack-dev-server
I've checked the packages in question and they are still depending on webpack 4 at the moment still.
Webpack-dev-middleware has updated master branch for webpack 5 but haven't tagged a release
Friendly-errors-webpack-plugin seems abandoned
If upgrading to the beta of laravel mix there seems to be loads of conflicts, but deleting node_modules and installing fresh seems to resolve most just leaving these few.
Simply running npm upgrade after everything is installed will bring up the list
@Nothing-Works I thought it was a duplicate originally and commented on that at first, but it seems he was installing laravel-mix 5, where this is a different error because this is the beta of laravel-mix 6
oh, sorry I did not notice that was v5.
node -v 12.8.1
npm -v 6.14.5
laravel-mix 6.0.0-beta.14
OS: ubuntu 18.0.4 on WSL2 windows 10
i'm working on testing migrating to laravel-mix 6.0.0-beta.14 and i see the same warnings:
npm WARN [email protected] requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
i was working through another issue:
3% setup run[webpack-cli] Error: Compiling RuleSet failed: Unexpected property test in condition (at ruleSet[1].rules[1].resource.test: resource => {
currentResource = resource
return true
})
at RuleSetCompiler.error (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:365:10)
at RuleSetCompiler.compileCondition (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:301:17)
at /root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/BasicMatcherRulePlugin.js:29:40
at Hook.eval [as call] (eval at create (/root/LinuxBindMounted/wright/app/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:15:1)
at RuleSetCompiler.compileRule (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:175:19)
at /root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:152:9
at Array.map (<anonymous>)
at RuleSetCompiler.compileRules (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:151:16)
at RuleSetCompiler.compileRule (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:182:30)
at /root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:152:9
at Array.map (<anonymous>)
at RuleSetCompiler.compileRules (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:151:16)
at RuleSetCompiler.compile (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/rules/RuleSetCompiler.js:68:22)
at new NormalModuleFactory (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/NormalModuleFactory.js:198:34)
at Compiler.createNormalModuleFactory (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/Compiler.js:948:31)
at Compiler.newCompilationParams (/root/LinuxBindMounted/wright/app/node_modules/webpack/lib/Compiler.js:967:30)
when i cleared out my node_modules folder and package.json to start from scratch
saw this warning, with a very bare-bones package.json:
{
"private": true,
"devDependencies": {
"babel-preset-minify": "^0.5.1",
"laravel-mix": "^6.0.0-beta.14",
"postcss": "^8.1.7",
"webpack": "^5.4.0"
},
"dependencies": {},
}
EDIT: Same with Yarn FWIW
yarn install v1.22.5
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > @types/browser-sync > [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning laravel-mix > webpack-dev-server > [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning laravel-mix > @types/browser-sync > chokidar > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning laravel-mix > @types/browser-sync > chokidar > braces > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning laravel-mix > @types/browser-sync > chokidar > braces > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "laravel-mix > [email protected]" has incorrect peer dependency "webpack@^4.0.0".
warning "laravel-mix > webpack-dev-server > [email protected]" has incorrect peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 20.18s.
I'm on MacOS 10.15.7 with node 15.1.0 and npm 7.0.8.
On a fresh project (totally empty directory), running npm install [email protected]:
````
george@GMACBOOKPRO npm % npm install [email protected]
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/webpack
npm WARN webpack@"^5.1.3" from [email protected]
npm WARN node_modules/laravel-mix
npm WARN laravel-mix@"6.0.0-beta.14" from the root project
npm WARN 3 more (babel-loader, css-loader, file-loader)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer webpack@"^4.0.0" from [email protected]
npm WARN node_modules/friendly-errors-webpack-plugin
npm WARN friendly-errors-webpack-plugin@"2.0.0-beta.2" from [email protected]
npm WARN node_modules/laravel-mix
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR! webpack@"^5.1.3" from [email protected]
npm ERR! node_modules/laravel-mix
npm ERR! laravel-mix@"6.0.0-beta.14" from the root project
npm ERR! peer webpack@">=2" from [email protected]
npm ERR! node_modules/babel-loader
npm ERR! babel-loader@"^8.1.0" from [email protected]
npm ERR! node_modules/laravel-mix
npm ERR! laravel-mix@"6.0.0-beta.14" from the root project
npm ERR! 2 more (css-loader, file-loader)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from [email protected]
npm ERR! node_modules/webpack-dev-server/node_modules/webpack-dev-middleware
npm ERR! webpack-dev-middleware@"^3.7.2" from [email protected]
npm ERR! node_modules/webpack-dev-server
npm ERR! webpack-dev-server@"^3.11.0" from [email protected]
npm ERR! node_modules/laravel-mix
npm ERR! laravel-mix@"6.0.0-beta.14" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/george/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/george/.npm/_logs/2020-11-17T18_59_41_343Z-debug.log
````
NPM 7 needs the --legacy-peer-deps flag right now. I'll be updating to a new version of webpack-dev-middleware once they release it. As for the friendly errors plugin causing a conflict I might have to replace that with a custom implementation.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an issue. --legacy-peer-deps works for now but would be good to have a better solution
What dependencies do you have installed? I _think_ it should be resolved unless you have other dependencies which have a webpack 4 peer dependency listed.
Ah yeah you are right, some are depending on webpack 4. 馃憣 Thanks for the response!
Most helpful comment
NPM 7 needs the
--legacy-peer-depsflag right now. I'll be updating to a new version ofwebpack-dev-middlewareonce they release it. As for the friendly errors plugin causing a conflict I might have to replace that with a custom implementation.