you-dont-need / You-Dont-Need-Momentjs

List of functions which you can use to replace moment.js + ESLint Plugin
MIT License
13.27k stars 318 forks source link

Unable to resolve dependency #108

Open JoaquimEsteves opened 3 years ago

JoaquimEsteves commented 3 years ago

Hullo, recently tried to add this plugin to a project only to be faced with some dependency issue shenanigans

Error Log: ```bash $ npm install --save-dev eslint-plugin-you-dont-need-momentjs npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: npm ERR! Found: eslint@7.22.0 npm ERR! node_modules/eslint npm ERR! dev eslint@"^7.19.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer eslint@"^5.5.0" from eslint-plugin-you-dont-need-momentjs@1.6.0 npm ERR! node_modules/eslint-plugin-you-dont-need-momentjs npm ERR! dev eslint-plugin-you-dont-need-momentjs@"*" 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. ```

I don't particularly feel like forcing the install, and help would be appreciated.

EmilyRosina commented 1 year ago

For anyone still frustrated by this, here's one option using npm:

Add this to package.json

  "overrides": {
    "eslint-plugin-you-dont-need-momentjs": {
      "eslint": "$eslint"
    }
  }

What this does: Overrides the version of eslint as defined eslint-plugin-you-dont-need-momentjs under peerDependencies.eslint.