Npm i fails during install through pre-commit hook
alchemistake opened this issue · comments
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
Expected behavior
It installs and works out of the box
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.
I think typedoc@0.17.6 should resolve both "~0.17.6" and "^0.16.7" but it doesn't for some odd reason.
could you please describe the steps to reproduce?
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
.pre-commit-config.yaml excerpt:
- repo: https://github.com/kucherenko/jscpd
rev: v3.5.10
hooks:
- id: jscpd
args: [--min-tokens, "50", --format, "json"]
ok, I think the problem is that the repo in monorepo and the main script located in packages, but I will investigate it
the issue has been fixed in jscpd@4.0.1