Title: 4.6.1 regression: local `language: node` hooks without `additional_dependencies` fail with `AssertionError` · Issue #3728 · pre-commit/pre-commit · GitHub
Open Graph Title: 4.6.1 regression: local `language: node` hooks without `additional_dependencies` fail with `AssertionError` · Issue #3728 · pre-commit/pre-commit
X Title: 4.6.1 regression: local `language: node` hooks without `additional_dependencies` fail with `AssertionError` · Issue #3728 · pre-commit/pre-commit
Description: search you tried in the issue tracker 4.6.1, "must have package.json or additional_dependencies" describe your issue Since v4.6.1, any repo: local hook using language: node without additional_dependencies fails to install its environment...
Open Graph Description: search you tried in the issue tracker 4.6.1, "must have package.json or additional_dependencies" describe your issue Since v4.6.1, any repo: local hook using language: node without additional_depen...
X Description: search you tried in the issue tracker 4.6.1, "must have package.json or additional_dependencies" describe your issue Since v4.6.1, any repo: local hook using language: node without additi...
Opengraph URL: https://github.com/pre-commit/pre-commit/issues/3728
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"4.6.1 regression: local `language: node` hooks without `additional_dependencies` fail with `AssertionError`","articleBody":"### search you tried in the issue tracker\n\n4.6.1, \"must have package.json or additional_dependencies\"\n\n### describe your issue\n\nSince v4.6.1, any `repo: local` hook using `language: node` without `additional_dependencies` fails to install its environment:\n\n```\nAn unexpected error has occurred: AssertionError: `language: node` must have package.json or additional_dependencies\n```\n\nThis worked in v4.6.0 and earlier. Hit in JupyterLab's release CI, where hooks like this one (running against the project's own node_modules) are common.\n\n#3719 changed `node.install_environment` to only use the prefix's `package.json` when `prefix.exists('.git')` is also true:\n\nhttps://github.com/pre-commit/pre-commit/blob/242ce8a25657be59f2770b50de41fe0fd508820d/pre_commit/languages/node.py#L76-L89\n\nBut for local repos the prefix comes from `store.make_local()` - the synthesized empty-template directory, which contains `empty_template_package.json` but is not a git repo. So `pkgs` is empty and the new assertion fires. Previously the dummy package was installed with plain `npm install -g .`, which succeeded.\n\n### pre-commit --version\n\n4.6.1\n\n### .pre-commit-config.yaml\n\n```yaml\nci:\n # Same schedule interval as dependabot see .github/dependabot.yml\n autoupdate_schedule: monthly\n # skip any check that needs internet access\n skip: [prettier, eslint, stylelint, shellcheck]\n\ndefault_language_version:\n node: system\n\nrepos:\n - repo: https://github.com/pre-commit/pre-commit-hooks\n rev: v6.0.0\n hooks:\n - id: forbid-new-submodules\n - id: end-of-file-fixer\n exclude: galata/.*-snapshots\n - id: check-case-conflict\n - id: check-executables-have-shebangs\n - id: requirements-txt-fixer\n - id: check-added-large-files\n - id: check-toml\n - id: check-yaml\n - id: debug-statements\n - id: check-builtin-literals\n - id: trailing-whitespace\n exclude: .bumpversion.cfg\n - id: check-merge-conflict\n - id: check-symlinks\n - id: mixed-line-ending\n\n - repo: https://github.com/python-jsonschema/check-jsonschema\n rev: 0.37.4\n hooks:\n - id: check-github-workflows\n\n # Check zizmor version is aligned with the one in .github/workflows/zizmor.yml\n - repo: https://github.com/zizmorcore/zizmor-pre-commit\n rev: e3eebf65325ccc992422292cb7a4baee967cf815 # frozen: v1.26.1\n hooks:\n - id: zizmor\n args: [\"--offline\"]\n\n - repo: https://github.com/codespell-project/codespell\n rev: v2.4.2\n hooks:\n - id: codespell\n args:\n - --ignore-words=.codespellignore\n - --skip=docs/source/api/**,docs/source/getting_started/changelog.md\n files: \\.(md|rst|txt)$\n\n # Check ruff version is aligned with the one in pyproject.toml\n - repo: https://github.com/astral-sh/ruff-pre-commit\n rev: v0.15.20\n hooks:\n - id: ruff\n args: [\"--fix\"]\n - id: ruff-format\n\n - repo: local\n hooks:\n - id: prettier\n name: prettier\n entry: jlpm\n args: [run, 'prettier:files']\n language: node\n types_or: [json, ts, tsx, javascript, jsx, css]\n exclude: \\.ipynb$\n - id: eslint\n name: eslint\n entry: 'npm run eslint:files'\n language: node\n types_or: [ts, tsx, javascript, jsx]\n - id: stylelint\n name: stylelint\n entry: 'npm run stylelint:files'\n language: node\n types: [css]\n - id: shellcheck\n name: shellcheck\n entry: bash ./scripts/shellcheck_lint.sh\n language: python\n additional_dependencies: [shellcheck-py==0.11.0.1]\n pass_filenames: false\n files: \\.sh$\n - id: integrity\n name: integrity\n entry: 'npm run integrity --force'\n language: node\n stages: [pre-push]\n```\n\n### ~/.cache/pre-commit/pre-commit.log (if present)\n\n_No response_","author":{"url":"https://github.com/krassowski","@type":"Person","name":"krassowski"},"datePublished":"2026-07-22T07:31:41Z","url":"https://github.com/pre-commit/pre-commit/issues/3728"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:481e547f-dd8a-9443-2008-ec4aeae770c7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B5D6:EA06E:3FB5090:50E3D21:6B01FE31 |
| html-safe-nonce | 8fcb39bff41670704e4405eb8d77997ab501cbad78330b992d41f7092d6c0b5b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUQ2OkVBMDZFOjNGQjUwOTA6NTBFM0QyMTo2QjAxRkUzMSIsInZpc2l0b3JfaWQiOiIzNTk4NTk2OTIxMjE3OTA4MjczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9fd0238ee6d508701b88bcd2b3ef547fea282918ea8b836f74de32871485c9a9 |
| hovercard-subject-tag | issue:4946590950 |
| github-keyboard-shortcuts | repository,issues,commits,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit/3728/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2a04249932f8019ef60eaf7419f86f5d267835b9b62e64cd2fbe88381c07c444/pre-commit/pre-commit/issues/3728 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2a04249932f8019ef60eaf7419f86f5d267835b9b62e64cd2fbe88381c07c444/pre-commit/pre-commit/issues/3728 |
| og:image:alt | search you tried in the issue tracker 4.6.1, "must have package.json or additional_dependencies" describe your issue Since v4.6.1, any repo: local hook using language: node without additional_depen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | krassowski |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/pre-commit/pre-commit git https://github.com/pre-commit/pre-commit.git |
| octolytics-dimension-user_id | 6943086 |
| octolytics-dimension-user_login | pre-commit |
| octolytics-dimension-repository_id | 17689377 |
| octolytics-dimension-repository_nwo | pre-commit/pre-commit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17689377 |
| octolytics-dimension-repository_network_root_nwo | pre-commit/pre-commit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width