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

Npm i fails during install through pre-commit hook #626

Open
alchemistake opened this issue Mar 8, 2024 · 5 comments
Open

Npm i fails during install through pre-commit hook #626

alchemistake opened this issue Mar 8, 2024 · 5 comments

Comments

@alchemistake
Copy link

alchemistake commented Mar 8, 2024

Describe the bug
Npm i fails with version clash installing through pre-commit hook(i think there is no version clash but npm is complaining)

To Reproduce
Add it to pre-commit-config.yaml
image

Expected behavior
It installs and works out of the box

Screenshots
image

An unexpected error has occurred: CalledProcessError: command: ('/Users/alchemistake/.cache/pre-commit/repoarqgf_1r/node_env-default/bin/node', '/Users/alchemistake/.cache/pre-commit/repoarqgf_1r/node_env-default/bin/npm', 'install', '--include=dev', '--include=prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1
stdout: (none)
stderr:
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR! 
    npm ERR! While resolving: jscpd-monorepo@3.3.0-rc.0
    npm ERR! Found: typedoc@0.17.6
    npm ERR! node_modules/typedoc
    npm ERR!   dev typedoc@"~0.17.6" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer typedoc@"^0.16.7" from typedoc-plugin-lerna-packages@0.3.0
    npm ERR! node_modules/typedoc-plugin-lerna-packages
    npm ERR!   dev typedoc-plugin-lerna-packages@"~0.3.0" 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! 
    npm ERR! For a full report see:
    npm ERR! /Users/alchemistake/.npm/_logs/2024-03-08T08_11_59_460Z-eresolve-report.txt

Desktop (please complete the following information):

  • OS: macOS (arm)
  • OS Version 13
  • NodeJS Version 18.18.2
  • jscpd version latest 3.5.10

Additional context
npm i fails when i pull the repo as well.

@alchemistake
Copy link
Author

I think typedoc@0.17.6 should resolve both "~0.17.6" and "^0.16.7" but it doesn't for some odd reason.

@kucherenko
Copy link
Owner

could you please describe the steps to reproduce?

@0xg0nz0
Copy link

0xg0nz0 commented Mar 9, 2024

I see this as well. It works fine with "npx jscpd" but fails with "pre-commit run --all-files" during installation of jscpd. From pre-commit.log:

### version information

pre-commit version: 3.6.2
git --version: git version 2.44.0
sys.version:
3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
sys.executable: /usr/local/py-utils/venvs/pre-commit/bin/python
os.name: posix
sys.platform: linux


### error information

An unexpected error has occurred: CalledProcessError: command: ('/home/vscode/.cache/pre-commit/repows7cwogt/node_env-system/bin/node', '/usr/local/share/nvm/versions/node/v20.11.1/bin/npm', 'install', '--include=dev', '--include=prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1

@0xg0nz0
Copy link

0xg0nz0 commented Mar 9, 2024

.pre-commit-config.yaml excerpt:

- repo: https://github.com/kucherenko/jscpd
  rev: v3.5.10
  hooks:
  - id: jscpd
    args: [--min-tokens, "50", --format, "json"]

@kucherenko
Copy link
Owner

ok, I think the problem is that the repo in monorepo and the main script located in packages, but I will investigate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants