Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

syntax error near unexpected token `(' #260

Closed
gausie opened this issue Jun 2, 2020 · 1 comment
Closed

syntax error near unexpected token `(' #260

gausie opened this issue Jun 2, 2020 · 1 comment

Comments

@gausie
Copy link

gausie commented Jun 2, 2020

Hi there, the folks at pre-commit (pre-commit/pre-commit#1483) asked me to post this bug report upstream

version information

pre-commit version: 2.4.0
sys.version:
    3.7.6 (default, May 14 2020, 16:05:05) 
    [GCC 9.3.0]
sys.executable: /home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/bin/python
os.name: posix
sys.platform: linux

error information

An unexpected error has occurred: CalledProcessError: command: ('/media/gausie/Shared (ext4)/cache/pre-commit/repo8x4lee2t/node_env-system/bin/node', '/usr/local/bin/npm', 'install')
return code: 2
expected return code: 0
stdout: (none)
stderr:
    /media/gausie/Shared (ext4)/cache/pre-commit/repo8x4lee2t/node_env-system/bin/node: line 2: syntax error near unexpected token `('
    /media/gausie/Shared (ext4)/cache/pre-commit/repo8x4lee2t/node_env-system/bin/node: line 2: `export NODE_PATH=/media/gausie/Shared (ext4)/cache/pre-commit/repo8x4lee2t/node_env-system/lib/node_modules'
    
Traceback (most recent call last):
  File "/home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/lib/python3.7/site-packages/pre_commit/error_handler.py", line 56, in error_handler
    yield
  File "/home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/lib/python3.7/site-packages/pre_commit/main.py", line 392, in main
    return run(args.config, store, args)
  File "/home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/lib/python3.7/site-packages/pre_commit/commands/run.py", line 368, in run
    install_hook_envs(hooks, store)
  File "/home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/lib/python3.7/site-packages/pre_commit/repository.py", line 200, in install_hook_envs
    _hook_install(hook)
  File "/home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/lib/python3.7/site-packages/pre_commit/repository.py", line 83, in _hook_install
    hook.prefix, hook.language_version, hook.additional_dependencies,
  File "/home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/lib/python3.7/site-packages/pre_commit/languages/node.py", line 93, in install_environment
    helpers.run_setup_cmd(prefix, ('npm', 'install'))
  File "/home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/lib/python3.7/site-packages/pre_commit/languages/helpers.py", line 25, in run_setup_cmd
    cmd_output_b(*cmd, cwd=prefix.prefix_dir)
  File "/home/gausie/.pyenv/versions/3.7.6/envs/rasa-x/lib/python3.7/site-packages/pre_commit/util.py", line 157, in cmd_output_b
    raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('/media/gausie/Shared (ext4)/cache/pre-commit/repo8x4lee2t/node_env-system/bin/node', '/usr/local/bin/npm', 'install')
return code: 2
expected return code: 0
stdout: (none)
stderr:
    /media/gausie/Shared (ext4)/cache/pre-commit/repo8x4lee2t/node_env-system/bin/node: line 2: syntax error near unexpected token `('
    /media/gausie/Shared (ext4)/cache/pre-commit/repo8x4lee2t/node_env-system/bin/node: line 2: `export NODE_PATH=/media/gausie/Shared (ext4)/cache/pre-commit/repo8x4lee2t/node_env-system/lib/node_modules'

I know this'll be something to do with my pyenv/weird directory names with spaces but I can't see how to fix this.
@asottile
Copy link
Contributor

asottile commented Jun 8, 2020

I fixed this in #259

@ekalinin ekalinin closed this as completed Jun 9, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants