node-ts-api-template icon indicating copy to clipboard operation
node-ts-api-template copied to clipboard

Incompatible peer dependency between eslint-plugin-prettier@^5.1.3 and prettier@^2.8.8

Open rabbanee opened this issue 7 months ago • 0 comments

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

  1. Create a minimal Node.js project with the following devDependencies:
    {
      "prettier": "^2.8.8",
      "eslint-plugin-prettier": "^5.1.3"
    }
    
  2. 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 prettier are supported by which versions of eslint-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:

Thank you for your time and effort maintaining this repository!

rabbanee avatar Jun 12 '25 15:06 rabbanee