Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-commit is broken when installing #9459

Closed
hsuanguo opened this issue Oct 20, 2020 · 22 comments · Fixed by #8937
Closed

Pre-commit is broken when installing #9459

hsuanguo opened this issue Oct 20, 2020 · 22 comments · Fixed by #8937
Labels
area:cli Issues with Prettier's Command Line Interface locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program

Comments

@hsuanguo
Copy link

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
@fisker
Copy link
Member

fisker commented Oct 20, 2020

Can you try

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

@hsuanguo
Copy link
Author

hsuanguo commented Oct 20, 2020

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]

@fisker
Copy link
Member

fisker commented Oct 21, 2020

We are migrating the pre-commit support to seperate repo.

@yajo
Copy link

yajo commented Oct 21, 2020

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? 🤔

@yajo
Copy link

yajo commented Oct 21, 2020

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... 😿 🙏

@fisker
Copy link
Member

fisker commented Oct 21, 2020

We had our version pinned and it was broken too... Did you move the git tag or something like that?

We didn't do anything, my guess is some npm deps just broken.

With this repo https://github.com/prettier/pre-commit, you'll get bundled Prettier, it's more stable.

@georgek
Copy link

georgek commented Oct 21, 2020

Looks like the format of the tags changed, so it now also needs to be "v2.1.2" instead of "2.1.2" etc.

It's a shame this broke existing pipelines somehow. Now all will have to be changed to the new repo.

@joao-p-marques
Copy link

Yes, although I am still facing an issue with plugins, that might be related to this: prettier/pre-commit#16

@hsuanguo
Copy link
Author

I think it might be more that that @georgek. If i just change the tag:

Yeah, you need change both the tag and repo.

@joao-p-marques
Copy link

Yeah, you need change both the tag and repo.

Yes. I misread, sorry.

@fisker
Copy link
Member

fisker commented Oct 21, 2020

I'll sorry for the tag changes, didn't notice the difference between these two repos.

zygoloid added a commit to carbon-language/carbon-lang that referenced this issue Oct 28, 2020
See prettier/prettier#9459 for details. Unclear whether this is a prettier bug or an npm bug, but pre-commit fails with new repositories without this change.
jonmeow pushed a commit to carbon-language/carbon-lang that referenced this issue Oct 28, 2020
See prettier/prettier#9459 for details. Unclear whether this is a prettier bug or an npm bug, but pre-commit fails with new repositories without this change.
nijel added a commit to WeblateOrg/meta that referenced this issue Oct 31, 2020
@thorn0 thorn0 added area:cli Issues with Prettier's Command Line Interface type:bug Issues identifying ugly output, or a defect in the program labels Nov 5, 2020
yajo pushed a commit to Tecnativa/doodba-copier-template that referenced this issue Nov 9, 2020
Recently prettier got broken badly (see prettier/prettier#9459 and all the related PRs/issues there).

This explains how to avoid that problem when updating templates.
github-actions bot pushed a commit to Tecnativa/doodba-copier-template that referenced this issue Nov 9, 2020
Recently prettier got broken badly (see prettier/prettier#9459 and all the related PRs/issues there).

This explains how to avoid that problem when updating templates.
key added a commit to key/django-project-template that referenced this issue Nov 16, 2020
bit172 added a commit to RGPosadas/Mull that referenced this issue Nov 19, 2020
If the cached pre-commit is deleted, pre-commit fails to install
prettier/prettier#9459
bit172 added a commit to RGPosadas/Mull that referenced this issue Nov 21, 2020
If the cached pre-commit is deleted, pre-commit fails to install
prettier/prettier#9459
bit172 added a commit to RGPosadas/Mull that referenced this issue Nov 22, 2020
If the cached pre-commit is deleted, pre-commit fails to install
prettier/prettier#9459
bit172 added a commit to RGPosadas/Mull that referenced this issue Nov 22, 2020
If the cached pre-commit is deleted, pre-commit fails to install
prettier/prettier#9459
bit172 added a commit to RGPosadas/Mull that referenced this issue Nov 22, 2020
If the cached pre-commit is deleted, pre-commit fails to install
prettier/prettier#9459
@TrekSoft
Copy link

TrekSoft commented Dec 9, 2020

@fisker - I see https://github.com/prettier/pre-commit mentions that it's been moved to https://github.com/pre-commit/mirrors-prettier so should we be updating the fix to point to that new one or is the prettier/pre-commit one still good to use?

@fisker
Copy link
Member

fisker commented Dec 9, 2020

Use the new one please.

yannickperrenet added a commit to orchest/orchest that referenced this issue Dec 22, 2020
cooperlees pushed a commit to psf/black that referenced this issue Jan 1, 2021
This fixes Prettier install failures similar to those seen in
prettier/prettier#9459, and is the solution
recommended there.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Mar 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:cli Issues with Prettier's Command Line Interface locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants