Incompatible peer dependency between eslint-plugin-prettier@^5.1.3 and prettier@^2.8.8
Description
When trying to install eslint-plugin-prettier@^5.1.3 alongside prettier@^2.8.8, I encountered the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/prettier
npm ERR! dev prettier@"^2.8.8" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer prettier@">=3.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-prettier
npm ERR! dev eslint-plugin-prettier@"^5.1.3" from the root project
Steps to Reproduce
- Create a minimal Node.js project with the following
devDependencies:{ "prettier": "^2.8.8", "eslint-plugin-prettier": "^5.1.3" } - Run
npm install
Expected Behavior
If eslint-plugin-prettier@^5.1.3 only supports prettier@>=3, it would be helpful to:
- Provide a clearer note in the documentation or release notes
- Possibly introduce a more helpful error message (if possible)
- Clarify which versions of
prettierare supported by which versions ofeslint-plugin-prettier
Actual Behavior
NPM fails to resolve the dependency tree due to a version mismatch between prettier and eslint-plugin-prettier.
Environment
- Node.js: v21.5.0
- npm: 10.x
- OS: Windows
- prettier: 2.8.8
- eslint-plugin-prettier: 5.1.3
Suggested Solution
Either:
- Update documentation to clearly indicate that
[email protected]only supportsprettier@>=3, or - If possible, maintain compatibility with
[email protected], or - Suggest older versions of
eslint-plugin-prettierfor those still using[email protected]
Thank you for your time and effort maintaining this repository!