lisaogren / axios-cache-adapter

Caching adapter for axios. Store request results in a configurable store to prevent unneeded network requests.
MIT License
725 stars 108 forks source link

Latest axios Conflicting peer dependency: axios@0.21.4 #273

Open mulib opened 1 year ago

mulib commented 1 year ago

package.json

...
    "axios": "^1.2.6",
    "axios-cache-adapter": "^2.7.3",
    "axios-cache-interceptor": "^1.0.1",
...

when running npm install (without --force or --legacy-peer-deps) I get a conlict error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: axios-cache-adapter@2.7.3
npm ERR! Found: axios@1.3.2
npm ERR! node_modules/axios
npm ERR!   axios@"^1.2.6" from the root project
npm ERR!   peer axios@"^1" from axios-cache-interceptor@1.0.1
npm ERR!   node_modules/axios-cache-interceptor
npm ERR!     axios-cache-interceptor@"^1.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer axios@"~0.21.1" from axios-cache-adapter@2.7.3
npm ERR! node_modules/axios-cache-adapter
npm ERR!   axios-cache-adapter@"^2.7.3" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: axios@0.21.4
npm ERR! node_modules/axios
npm ERR!   peer axios@"~0.21.1" from axios-cache-adapter@2.7.3
npm ERR!   node_modules/axios-cache-adapter
npm ERR!     axios-cache-adapter@"^2.7.3" 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.

can you tell when you going to update dependencies? or please suggest other solution

arthurfiorette commented 1 year ago

Axios-cache-adapter only works for axios v0, and axios-cache-interceptor for both, please choose either axios-cache-interceptor or axios-cache-adapter, as they serve the same purpose.

P.S I'm the maintainer of axios-cache-interceptor, this predecessor.