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

[BUG] npm error enoent This is related to npm not being able to find a file #16

Open
mloskot opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mloskot
Copy link
Contributor

mloskot commented Oct 24, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.9.7

AzureRM Provider Version

n/a

Affected Resource(s)/Data Source(s)

n/a

Terraform Configuration Files

n/a

Debug Output/Panic Output

[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/tofuutils/pre-commit-opentofu.
[INFO] Initializing environment for https://github.com/alessandrojcm/commitlint-pre-commit-hook.
[INFO] Initializing environment for https://github.com/alessandrojcm/commitlint-pre-commit-hook:@commitlint/config-conventional.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check json...........................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
check for broken symlinks............................(no files to check)Skipped
check for added large files..............................................Passed
detect private key.......................................................Passed
OpenTofu fmt.............................................................Passed
OpenTofu docs............................................................Passed
OpenTofu validate........................................................Passed
OpenTofu validate with tflint............................................Passed
OpenTofu validate with trivy.............................................Passed
[INFO] Installing environment for https://github.com/alessandrojcm/commitlint-pre-commit-hook.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/home/mloskot/.cache/pre-commit/repo6psd8eqv/node_env-default/bin/node', '/home/mloskot/.cache/pre-commit/repo6psd8eqv/node_env-default/bin/npm', 'pack')
return code: 254
stdout: (none)
stderr:
    (node:56300) 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/mloskot/.cache/pre-commit/repo6psd8eqv/ (null) seems to be corrupted. Trying again.
    npm warn tarball tarball data for file:/home/mloskot/.cache/pre-commit/repo6psd8eqv/ (null) seems to be corrupted. Trying again.
    npm error code ENOENT
    npm error syscall lstat
    npm error path /home/mloskot/.cache/pre-commit/repo6psd8eqv/ode_env-default/lib/node_modules/npm/node_modules/sprintf-js/dist/.gitattributes
    npm error errno -2
    npm error enoent ENOENT: no such file or directory, lstat '/home/mloskot/.cache/pre-commit/repo6psd8eqv/ode_env-default/lib/node_modules/npm/node_modules/sprintf-js/dist/.gitattributes'
    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/mloskot/.npm/_logs/2024-10-24T15_48_13_059Z-debug-0.log
Check the log at /home/mloskot/.cache/pre-commit/pre-commit.log

Expected Behaviour

git commit runs all pre-commit hooks successfully.

Actual Behaviour

https://github.com/alessandrojcm/commitlint-pre-commit-hook is failing with the panic output above

Steps to Reproduce

Make change like in PR #15 and try to commit it with pre-commit hooks installed.

Important Factoids

Ubuntu 24.04.1 LTS, git version 2.43.0

References

@Shr3ps
Copy link
Member

Shr3ps commented Oct 25, 2024

Arf, I think we all have an "old" nodejs and the plugin in cache locally. That's why we probably dont reproduce :'(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants