Skip to content

Unable to install node environment on FreeBSD11 #1331

Closed

Description

@kbsezginel

I am having trouble installing a node environment for prettier on FreeBSD11.
I tried using the local prettier or from github but both fail the following way:

An unexpected error has occurred: CalledProcessError: command: ('/usr/local/bin/python3.6', '-mnodeenv', '--prebuilt', '--clean-src', '/home/kbsezginel/.cache/pre-commit/repoe0dwik6_/node_env-default')
return code: 1
expected return code: 0
stdout: (none)
stderr:
     * Install prebuilt node (13.8.0) .
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/usr/local/lib/python3.6/site-packages/nodeenv.py", line 1517, in <module>
        main()
      File "/usr/local/lib/python3.6/site-packages/nodeenv.py", line 1113, in main
        create_environment(env_dir, opt)
      File "/usr/local/lib/python3.6/site-packages/nodeenv.py", line 936, in create_environment
        install_node(env_dir, src_dir, opt)
      File "/usr/local/lib/python3.6/site-packages/nodeenv.py", line 700, in install_node
        install_node_wrapped(env_dir, src_dir, opt)
      File "/usr/local/lib/python3.6/site-packages/nodeenv.py", line 723, in install_node_wrapped
        download_node_src(node_url, src_dir, opt, prefix)
      File "/usr/local/lib/python3.6/site-packages/nodeenv.py", line 552, in download_node_src
        dl_contents = io.BytesIO(urlopen(node_url).read())
      File "/usr/local/lib/python3.6/site-packages/nodeenv.py", line 580, in urlopen
        return urllib2.urlopen(req)
      File "/usr/local/lib/python3.6/urllib/request.py", line 223, in urlopen
        return opener.open(url, data, timeout)
      File "/usr/local/lib/python3.6/urllib/request.py", line 532, in open
        response = meth(req, response)
      File "/usr/local/lib/python3.6/urllib/request.py", line 642, in http_response
        'http', request, response, code, msg, hdrs)
      File "/usr/local/lib/python3.6/urllib/request.py", line 570, in error
        return self._call_chain(*args)
      File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
        result = func(*args)
      File "/usr/local/lib/python3.6/urllib/request.py", line 650, in http_error_default
        raise HTTPError(req.full_url, code, msg, hdrs, fp)
    urllib.error.HTTPError: HTTP Error 404: Not Found

Seems to be a problem with using a wrong url to install node env. I don't really understand why it needs a url to use a local repo, or a local installation though. Here is some information about the system:

python3.6 -c "import platform; print(platform.platform())"
FreeBSD-11.3-RELEASE-p5-amd64-64bit-ELF
pre-commit --version
pre-commit 2.0.1

.pre-commit-config.yaml:

repos:
  - repo: /data/repos/black
    rev: stable
    hooks:
      - id: black
        language: python
        language_version: python3.6
  - repo: local
    hooks:
    - id: prettier
      name: prettier
      entry: prettier
      language: node

Any idea what the issue might be?

Activity

  1. asottile commented on Feb 12, 2020

    @asottile
    Member

    with language: node pre-commit will provision an isolated nodejs environment to install the hook into, it does this via nodeenv

    it appears there is no prebuilt nodejs binary for the given platform: https://nodejs.org/download/release/v13.8.0/

    I'd suggest opening an issue against nodeenv, I suspect it's having trouble finding the .tar.gz for the source download

    if you don't want to have provisioned environments, you can use the language: system escape hatch to call whatever binaries you have installed manually outside of the management of pre-commit

  2. kbsezginel commented on Feb 12, 2020

    @kbsezginel
    Author

    Thank you!

  3. asottile commented on Feb 12, 2020

    @asottile
    Member

    no problem! glad to help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions