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 errors when using any node related pre-commits #104

Open
EricDavidWells opened this issue Oct 17, 2024 · 3 comments
Open

npm errors when using any node related pre-commits #104

EricDavidWells opened this issue Oct 17, 2024 · 3 comments

Comments

@EricDavidWells
Copy link

EricDavidWells commented Oct 17, 2024

Noticed errors when using any of the hooks which specify language: node.

Running on Ubuntu 20.04
pre-commit version 3.5.0
pre-commit-config.yaml:

  - repo: https://github.com/tier4/pre-commit-hooks-ros
    rev: v0.10.0
    hooks:
      # - id: flake8-ros
      - id: prettier-xacro
      - id: prettier-launch-xml
      - id: prettier-package-xml
      # - id: ros-include-guard
      - id: sort-package-xml

errors:

[INFO] Initializing environment for https://github.com/tier4/pre-commit-hooks-ros:[email protected],@prettier/[email protected].
[INFO] Installing environment for https://github.com/tier4/pre-commit-hooks-ros.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/home/rico/.cache/pre-commit/repot_n4ea6k/node_env-default/bin/node', '/home/rico/.cache/pre-commit/repot_n4ea6k/node_env-default/bin/npm', 'pack')
return code: 254
stdout: (none)
stderr:
    (node:955063) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
    (Use `node --trace-warnings ...` to show where the warning was created)
    npm warn tarball tarball data for file:/home/rico/.cache/pre-commit/repot_n4ea6k/ (null) seems to be corrupted. Trying again.
    npm warn tarball tarball data for file:/home/rico/.cache/pre-commit/repot_n4ea6k/ (null) seems to be corrupted. Trying again.
    npm error code ENOENT
    npm error syscall lstat
    npm error path /home/rico/.cache/pre-commit/repot_n4ea6k/ode_env-default/bin/activate
    npm error errno -2
    npm error enoent ENOENT: no such file or directory, lstat '/home/rico/.cache/pre-commit/repot_n4ea6k/ode_env-default/bin/activate'
    npm error enoent This is related to npm not being able to find a file.
    npm error enoent
    npm error A complete log of this run can be found in: /home/rico/.npm/_logs/2024-10-17T18_35_28_469Z-debug-0.log
Check the log at /home/rico/.cache/pre-commit/pre-commit.log

@v8p1197
Copy link

v8p1197 commented Oct 18, 2024

I have the same error as @EricDavidWells with pre-commit 3.7.0, using the release v0.10.0 of this repo.

@ummelen22
Copy link

ummelen22 commented Oct 21, 2024

I'm experiencing the same issue. Is there any update on this?
Using pre-commit 3.8.0 and release 0.10.0 of this repo.

@cbrxyz
Copy link

cbrxyz commented Oct 22, 2024

Looks like this error is from pre-commit/pre-commit#3339. For now, specifying this at the top of my yaml file worked:

default_language_version:
  node: lts

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

4 participants