Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm requires a peer of

My vue project stops working when I try to npm install any new package. I was installing axios.

First I got,

npm install
npm WARN [email protected] requires a peer of ajv@^6.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.
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.

so I install those packages,

npm install [email protected]  ajv@^6.0.0 [email protected]  webpack@^4.0.0 [email protected]  webpack@^4.0.0 [email protected]  webpack@^4.0.0 

Then I get these warnings,

npm WARN [email protected] requires a peer of webpack@^3.1.0
  but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of
  webpack@1 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3 but
  none is installed. You must install peer dependencies yourself.

which tell me to use webpack 3

So I ran,

npm install webpack@^3.1.0 [email protected] [email protected]

Which then gives me the following warning, telling to use webpack4.

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.
npm WARN [email protected] requires a peer of webpack@^4.0.0 but none
  is installed. You must install peer dependencies yourself.

How can I solve this problem?

Thanks,

like image 960
Shane G Avatar asked Nov 15 '18 14:11

Shane G


1 Answers

Have you tried installing webpack@^4.0.0?

npm install webpack@^4.0.0
like image 193
Rafaël Moser Avatar answered Sep 24 '22 00:09

Rafaël Moser