prettier: Pre-commit is broken when installing

Environments:

  • Prettier Version: 2.1.2
  • Running Prettier via: pre-commit
  • Runtime:
  • Operating System: Linux

Steps to reproduce:

  - repo: https://github.com/prettier/prettier
    rev: 2.1.2
    hooks:
      - id: prettier
        exclude_types: [json]

Expected behavior:

Actual behavior:

An unexpected error has occurred: CalledProcessError: command: ('/home/xuan/.cache/pre-commit/repo88mn0n_k/node_env-default/bin/node', '/home/xuan/.cache/pre-commit/repo88mn0n_k/node_env-default/bin/npm', 'install')
return code: 1
expected return code: 0
stdout: (none)
stderr:
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR! 
    npm ERR! While resolving: prettier@2.1.2
    npm ERR! Found: remark-parse@8.0.3
    npm ERR! node_modules/remark-parse
    npm ERR!   remark-parse@"8.0.3" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer remark-parse@"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from remark-math@1.0.6
    npm ERR! node_modules/remark-math
    npm ERR!   remark-math@"1.0.6" 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.
    npm ERR! 
    npm ERR! See /home/xuan/.npm/eresolve-report.txt for a full report.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/xuan/.npm/_logs/2020-10-20T20_31_29_631Z-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 12
  • Comments: 22 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Could you please roll back whatever change broke all prettier pre-commit configurations and provide a smoother migration path please? All our tests went red everywhere, not nice… 😿 🙏

Can you try

  - repo: https://github.com/prettier/pre-commit
    rev: 2.1.2
    hooks:
      - id: prettier
        exclude_types: [json]

Use the new one please.

But should that migration break preexisting configurations? We had our version pinned and it was broken too… Did you move the git tag or something like that? 🤔

This works, thank you very much !! The previous repo worked until today, didn’t know that there is an update.

  - repo: https://github.com/prettier/pre-commit
    rev: v2.1.2
    hooks:
      - id: prettier
        exclude_types: [json]