NASA-IMPACT / NASA-IMPACT/veda-docs

Pre-commit Error with Prettier

Open
#239 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Jupyter Notebook
Stars
10
Forks
16
Avg merge
2d 31m
Merged PRs (30d)
4

Description

Not sure if it's just my system but if I try to run pre-commit, I'm getting an error with nodeenv which is coming from prettier.
I have not been able to track down the specific cause.

An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/python3', '-mnodeenv', '--prebuilt', '--clean-src', '/home/--/.cache/pre-commit/repo0o04rml7/node_env-default')
return code: 1
stdout: (none)
stderr:
    /usr/lib/python3/dist-packages/nodeenv.py:24: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
      import pipes
    /usr/lib/python3/dist-packages/nodeenv.py:37: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      from pkg_resources import parse_version
    Traceback (most recent call last):
      File "<frozen runpy>", line 198, in _run_module_as_main
      File "<frozen runpy>", line 88, in _run_code
      File "/usr/lib/python3/dist-packages/nodeenv.py", line 1042, in <module>
        main()
      File "/usr/lib/python3/dist-packages/nodeenv.py", line 881, in main
        opt.node = get_last_stable_node_version()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3/dist-packages/nodeenv.py", line 835, in get_last_stable_node_version
        return links[-1][0]
               ~~~~~^^^^
    IndexError: list index out of range

work around was

SKIP=prettier pre-commit run |git commit ....

but would love to actually fix

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with pre-commit and the Prettier hook, then inspect the reported nodeenv traceback and its version lookup. Done means the Prettier hook completes successfully without requiring the documented SKIP=prettier workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, node.js, python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.