mongolyy / reviewdog-action-biome

MIT License
28 stars 4 forks source link

Installing Biome failed due to peerOptional package error #48

Closed jellydn closed 5 months ago

jellydn commented 5 months ago

Reproduce steps:

npm ERR! code ERESOLVE
  npm ERR! ERESOLVE could not resolve
  npm ERR! 
  npm ERR! While resolving: moleculer@0.14.33
  npm ERR! Found: pino@9.0.0
  npm ERR! node_modules/pino
  npm ERR!   pino@"9.0.0" from the root project
  npm ERR! 
  npm ERR! Could not resolve dependency:
  npm ERR! peerOptional pino@"^6.0.0 || ^7.0.0 || ^8.0.0" from moleculer@0.14.33
  npm ERR! node_modules/moleculer
  npm ERR!   moleculer@"0.14.33" from the root project
  npm ERR!   moleculer@"^0.14.33" from moleculer-connect@0.2.2
  npm ERR!   node_modules/moleculer-connect
  npm ERR!     dev moleculer-connect@"0.2.2" from the root project
  npm ERR!   3 more (moleculer-io, moleculer-web, moleculer-zod-validator)
  npm ERR! 
  npm ERR! Conflicting peer dependency: pino@8.21.0
  npm ERR! node_modules/pino
  npm ERR!   peerOptional pino@"^6.0.0 || ^7.0.0 || ^8.0.0" from moleculer@0.14.33
  npm ERR!   node_modules/moleculer
  npm ERR!     moleculer@"0.14.33" from the root project
  npm ERR!     moleculer@"^0.14.33" from moleculer-connect@0.2.2
  npm ERR!     node_modules/moleculer-connect
  npm ERR!       dev moleculer-connect@"0.2.2" from the root project
  npm ERR!     3 more (moleculer-io, moleculer-web, moleculer-zod-validator)
  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! 
  npm ERR! For a full report see:
  npm ERR! /home/runner/.npm/_logs/[202](https://github.com/jellydn/moleculer-typescript-template/actions/runs/8907929229/job/24462654550?pr=596#step:3:209)4-05-02T10_46_49_188Z-eresolve-report.txt

  npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2024-05-02T10_46_49_188Z-debug-0.log
  Error: Process completed with exit code 1.

Suggestion

Could we have a flag to pass to install biome or use a different package manager? Thank you for your work.

I also opened a PR on https://github.com/moleculerjs/moleculer/pull/1282 but let's see if it would resolve the issue.

mongolyy commented 5 months ago

@jellydn Thanks for making the issue.

Could we have a flag to pass to install biome or use a different package manager?

You can install biome manually. It checks if biome is installed and if it is, npm install is not executed. https://github.com/mongolyy/reviewdog-action-biome/blob/main/lib/biome.sh#L4-L17

If you want to install it manually, you will have to install it using your favorite package manager in the step before calling the mongolyy/reviewdog-action-biome@v1 step.

I have not actually tried this, but I believe it works well if you pre-install as follows:

    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v3
        name: Install pnpm
        with:
          version: 9
          run_install: true
      - uses: mongolyy/reviewdog-action-biome@v1
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review
jellydn commented 5 months ago

This works. Thanks, @mongolyy.