Hi,
I see that there is a peer dependency to require webpack 1.3 or higher that has been checked in for over a year.
"webpack": ">=1.3.0 <3"
As far as I can tell, there is no webpack version 1.3 as the highest is 1.12.9.
Can this peer dependency version be fixed so it does not require a non-existent version?
It is causing these warnings when I install:
angular2-webpack-starter$ npm install --global webpack-dev-server
/Users/beyondenergy/.npm-packages/bin/webpack-dev-server -> /Users/beyondenergy/.npm-packages/lib/node_modules/webpack-dev-server/bin/webpack-dev-server.js
/Users/beyondenergy/.npm-packages/lib
โโโ UNMET PEER DEPENDENCY webpack@>=1.3.0 <3
โโโฌ [email protected]
โโโ UNMET PEER DEPENDENCY webpack@>=1.0.0 <3
npm WARN EPEERINVALID [email protected] requires a peer of webpack@>=1.3.0 <3 but none was installed.
npm WARN EPEERINVALID [email protected] requires a peer of webpack@>=1.0.0 <3 but none was installed.
me too, I have the same error !
Update:
I have succeed at installing webpack-dev-server with this version
npm install --save-dev [email protected]
I'm also receiving this error, Would this cause an internal issues with webpack?
@Iliyass it's not work for npm install [email protected] -g
Same issue and solved.
It's not about the version, just DO NOT use -g or --global, and install it into local project, it works.
Though I still want to install it globally...
It looks like the version of webpack that is installed by npm by default is too old and doesn't meet the version requirements (webpack@>=1.0.0 <3). Omitting -g has no effect for me.
Peer Dependencies are no longer implicitly install as of node 5 check here. The latest version is Webpack is being installed through the devDependences. The peerDependencies code in package.json just hasn't been removed yet.
Thanks @lenell16. So if:
[t]his shifts the responsibility for fulfilling peer dependencies from library / framework / plugin maintainers to application authors
Shouldn't the latest version of webpack and webpack-dev-server just install with the basic install commands on the latest node and npm versions, and the beta non-resolving libraries be for edge developers?
For example using node 5.6.0 and npm 3.6.0 and run npm install webpack webpack-dev-server --save-dev on a brand new project I get unmet dependency errors.
Updates package.json:
"devDependencies": {
"webpack": "^2.1.0-beta.1", // If I set this manually to the latest non-beta tag
// "^1.12.13" it works fine.
"webpack-dev-server": "^1.14.1"
}
And gives the following npm console output:
โโโฌ UNMET PEER DEPENDENCY [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโฌ [email protected]
โ โ โ โ โ โโโ [email protected]
โ โ โ โ โโโ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โโโ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โโโ [email protected]
โโโ [email protected]
โโโฌ [email protected]
โ โโโ [email protected]
โโโ UNMET PEER DEPENDENCY webpack@>=1.0.0 <3
โโโฌ [email protected]
โโโ [email protected]
npm WARN [email protected] requires a peer of webpack@>=1.3.0 <3 but none was installed.
npm WARN [email protected] requires a peer of webpack@>=1.0.0 <3 but none was installed.
-- UNMET PEER DEPENDENCY webpack@^1.3.0
Same here...Ubuntu 14.04.3 LTS...
Same here using npm 3.6.0 and node 5.7.1
+1 on this issue! Got the same problem on the stable versions using the -g flags, without those it seem to work.
Using: webpack 1.12.14
and webpack-dev-server: 1.14.1
Can't use this combination global even though they are the last stable releases. Which seems to me like a bug, or should be explained somewhere if there is a reason why it cannot be used global.
Same issue here.
For betas it's because webpack@>=2.0.3-beta resolves to webpack@^1.12.14 and etc. Looks like an old bug in npm. Even there http://semver.npmjs.com/ it just gives no results. Funny, but e.g. >=1.0.0-beta1 works fine.
Interested in beta (e.g. @mummybot) you should try this commit (isn't released at the moment) https://github.com/webpack/webpack-dev-server/commit/202165717b974392c3048e52fad1e83468129438. It works.
I was having the same issue, and came across this other closed PR (https://github.com/webpack/webpack-dev-server/issues/429). Not quite expert-level enough to say why this works, but it does. Possibly it's because my global npm dir has always been ~/.npm (back long before npm was 3.x when they changed some dependency management)??
+1 No error installing it locally, but globally.
webpack version is 1.12.14, though npm install -g webpack-dev-server tells
/usr/local/bin/webpack-dev-server -> /usr/local/lib/node_modules/webpack-dev-server/bin/webpack-dev-server.js
/usr/local/lib
โโโ UNMET PEER DEPENDENCY webpack@>=1.3.0 <3
โโโฌ [email protected]
โโโ UNMET PEER DEPENDENCY webpack@1 || ^2.1.0-beta
Fix:
$ npm install -g webpack
$ npm install -g webpack-dev-server <- will error
$ webpack-dev-server <- seems to work fine reguardless
Nice link to http://semver.npmjs.com/ @arantir ! The reason >=1.0.0-beta1 works fine is that it is excluding the offending beta tag 2.0.0-beta, not sure why given there is no ^ to fix it to the major versions and 2 is greater than 1.
Generally I am not keen on installing webpack and webpack-dev-server globally. IMHO it is better to have all environmental packages included as part of a project so that setup for different developers is a known quantity.
My question to the webpack-dev-server dev contributors: why the have published the beta as the latest tag on npm such that npm install webpack-dev-server installs this rather than the latest stable release 1.14.1?
Same issue here! Fedora 23, Node.js 5.10.1, NPM 3.8.5.
npm WARN [email protected] requires a peer of webpack@>=1.3.0 <3 but none was installed.
npm WARN [email protected] requires a peer of webpack@1 || ^2.1.0-beta but none was installed.
The same issue when I install webpack with newest version --2.1.0-beta.6.
Node.js-- 5.4.0, Npm --3.3.12
npm WARN EPEERINVALID [email protected] requires a peer of webpack@>=1.3.0 <3 but none was installed.
npm WARN EPEERINVALID [email protected] requires a peer of webpack@1 || ^2.1.0-beta but none was installed.
Getting this unmet peer dependency message
โ ~ npm install webpack-dev-server -g
/usr/local/bin/webpack-dev-server -> /usr/local/lib/node_modules/webpack-dev-server/bin/webpack-dev-server.js
/usr/local/lib
โโโ UNMET PEER DEPENDENCY webpack@>=1.3.0 <3
โโโฌ [email protected]
โโโ UNMET PEER DEPENDENCY webpack@1 || ^2.1.0-beta
npm WARN [email protected] requires a peer of webpack@>=1.3.0 <3 but none was installed.
npm WARN [email protected] requires a peer of webpack@1 || ^2.1.0-beta but none was installed.
I think the solution is to install both webpack and webpack-dev-server at the same time. If you already have webpack installed, you don't need to uninstall it first. This was the solution for me.
npm install --global webpack webpack-dev-server
@janaagaard75 That suppressed the warning, but did not resolve the version missmatch. You'll get the same result installing them seperately, only diff is the warning.
Same issue here. Ubuntu 16.04, Nodejs v4.2.6, Npm v3.5.2.
+1
Same here.
NPM 3.10.3
Node 6.3.1
vagrant@vagrant-ubuntu-trusty-64:/vagrant/app_ng$ npm install -g --no-bin-links
[email protected]
/home/vagrant/.nvm/versions/node/v6.3.1/lib
โโโ UNMET PEER DEPENDENCY webpack@>=1.3.0 <3
โโโฌ [email protected]
โโโ UNMET PEER DEPENDENCY webpack@1 || ^2.1.0-beta
npm WARN [email protected] requires a peer of webpack@>=1.3.0 <3 but none was installed.
npm WARN [email protected] requires a peer of webpack@1 || ^2.1.0-beta but none was installed.
Weirdly enough it works in Win7 just fine.
node 6.2.1
npm 3.9.3
So, what the heck is wrong with webpack? is this a zombie project or how come no one from the contributors seem to comment about getting it fixed?
Having the same problem
/usr/local/lib
โโโ UNMET PEER DEPENDENCY webpack@>=1.3.0 <3
โโโฌ [email protected]
โโโ UNMET PEER DEPENDENCY webpack@1 || ^2.1.0-beta
Fixed my my problem. I was using fish in my command line shell with webstorm after removing it all seems to work fine but not quite sure why. But I hope this helps someone.
I was able to fix this problem by installing the last version of webpack as a dev dependency too.
$ npm install [email protected] --save-dev
Dupe of #363.
when i installed webpack localy it fixed the issue
For me, the update of npm solved:
sudo npm install -g npm
yes, I just do :
sudo npm update
npm install --save-dev webpack-dev-server
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for pinkie-promise
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/srikanthchebrolu/.npm/_logs/2018-01-06T20_54_28_968Z-debug.log
With o


@Ahren110, your errors are not relevant to this specific issue, it's about npm problem. See https://github.com/npm/registry/issues/255 for reference
This is my solution. Install 3 packages together.
npm install -g webpack webpack-dev-server webpack-cli
No @bakkujp , it doesn't solve it.
Whenever I try to install " npm install && bower install " , I get this error .
Can anyone please suggest a solution
$ npm install && bower install
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
[email protected] install D:\github\from branch-2\ui\node_modules\phantomjs
node install.js
invalid configloglevel="notice"
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-windows.zip
Saving to C:\Users\user\AppData\Local\Temp\phantomjs\phantomjs-1.9.7-windows.zip
Receiving...
Error making request.
Error: connect ETIMEDOUT 18.205.93.0:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14)
Please report this full log at https://github.com/Medium/phantomjs
npm WARN [email protected] requires a peer of grunt@~1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2018-10-12T12_56_25_047Z-debug.log
Hey guys,
I got the same error message. I found this on Stack Overflow, and it works.
run this on the command line --> npm i -D webpack@latest
npm audit fix to fix them, or npm audit for detailsHere is the solution that worked for me. All too often you either have a hidden dependency issue or in other cases you have a corrupt package/file.
ERROR MESSAGE:
npm WARN [email protected] requires a peer of webpack@^1 || ^2 || ^3 but none is installed. You must install peer dependencies yourself.
SOLUTION 1:
Install NPM check updates module. Note this is a global utility.
sudo npm install -g npm-check-updates
Once install run it
ncu -u
npm update SOLUTION 2 (not recommended but sometimes it is the only option):
If the problem continues you might have a problem module or a file. In that case I delete the local app node_modules directory and the package-lock.json (NOT!! THE package.json file as you will lose your config). Then run npm install to reinstall modules and dependencies.
EXAMPLE OF MY package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.19",
"browser-sync": "^2.26.7",
"browser-sync-webpack-plugin": "2.2.2",
"cross-env": "^5.2",
"laravel-mix": "^4.1.2",
"laravel-mix-purgecss": "^4.1.0",
"laravel-mix-tailwind": "^0.1.0",
"lodash": "^4.17.15",
"popper.js": "^1.15",
"resolve-url-loader": "^3.1.0",
"sass": "^1.22.10",
"sass-loader": "^8.0.0",
"tailwindcss": "^1.1.2",
"vue": "^2.6.10",
"vue-template-compiler": "^2.6.10",
"clean-webpack-plugin": "^3.0.0",
"purgecss-webpack-plugin": "^1.5.0",
"purify-css": "^1.2.5",
"purifycss-webpack": "^0.7.0",
"webpack-bundle-analyzer": "^3.4.1",
"webfontloader": "^1.6.28",
"vue-loader": "^15.7.1"
},
"dependencies": {
"animejs": "^3.1.0",
"vue-animejs": "^2.1.1",
"apexcharts": "^3.8.5",
"vue-apexcharts": "^1.4.0",
"moment": "^2.24.0",
"portal-vue": "^2.1.6"
}
}
Most helpful comment
I think the solution is to install both webpack and webpack-dev-server at the same time. If you already have webpack installed, you don't need to uninstall it first. This was the solution for me.