Skip to content

TSLint exits with error code 127 (Command not found?) #1666

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

Closed
jaalzateolaya opened this issue Jun 20, 2018 · 11 comments
Closed

TSLint exits with error code 127 (Command not found?) #1666

jaalzateolaya opened this issue Jun 20, 2018 · 11 comments
Labels

Comments

@jaalzateolaya
Copy link

Information

VIM version

:version
VIM - Vi IMproved 8.1 (2018 May 17, compiled May 25 2018 00:50:25)
Included patches: 1-22
Compiled by Arch Linux 

Operating System: Linux 4.16.13-2-ARCH GNU/Linux

:ALEInfo


 Current Filetype: typescript
Available Linters: ['eslint', 'tslint', 'tsserver', 'typecheck']
  Enabled Linters: ['eslint', 'tslint', 'tsserver', 'typecheck']
 Linter Variables:

let g:ale_typescript_tslint_config_path = ''
let g:ale_typescript_tslint_executable = 'tslint'
let g:ale_typescript_tslint_ignore_empty_files = 0
let g:ale_typescript_tslint_rules_dir = ''
let g:ale_typescript_tslint_use_global = 0
let g:ale_typescript_tsserver_config_path = ''
let g:ale_typescript_tsserver_executable = 'tsserver'
let g:ale_typescript_tsserver_use_global = 0
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_lint_on_insert_leave = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_list_window_size = 10
let g:ale_list_vertical = 0
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = {}
let g:ale_pattern_options_enabled = 0
let g:ale_set_balloons = 1
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(executable check - failure) eslint
(executable check - success) [project_path]/node_modules/.bin/tslint
(started) ['/bin/bash', '-c', 'cd ''[project_path]/src/pages/booking'' && ''[project_path]/node_modules/.bin/tslint'' --format json -c ''[project_path]/tslint.json'' ''/tmp/v1sCbVA/6/booking.ts''']
(started) ['/bin/bash', '-c', '[project_path]/node_modules/.bin/tsserver']
(executable check - failure) typecheck
(executable check - failure) eslint
(finished - exit code 127) ['/bin/bash', '-c', 'cd ''[project_path]/src/pages/booking'' && ''[project_path]/node_modules/.bin/tslint'' --format json -c ''[project_path]/tslint.json'' ''/tmp/v1sCbVA/7/booking.ts''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) typecheck

What went wrong

Linter stops working and as you can tell from ALEInfo the command exits with 127 status code which seems to be Command not found error in bash.

When I try to run the entire command from bash it works as expected, and everything is installed

Reproducing the bug

  1. Open GVim.
  2. Open a TypeScript file.
  3. Make any change.
@w0rp
Copy link
Member

w0rp commented Jun 20, 2018

Could you create an example project on GitHub which reproduces the issue? I won't be able to reproduce this issue on my machine.

@jaalzateolaya
Copy link
Author

I tried on DomesticApp/ionic-test-doubles and I managed to reproduce the same error:


 Current Filetype: typescript
Available Linters: ['eslint', 'tslint', 'tsserver', 'typecheck']
  Enabled Linters: ['eslint', 'tslint', 'tsserver', 'typecheck']
 Linter Variables:

let g:ale_typescript_tslint_config_path = ''
let g:ale_typescript_tslint_executable = 'tslint'
let g:ale_typescript_tslint_ignore_empty_files = 0
let g:ale_typescript_tslint_rules_dir = ''
let g:ale_typescript_tslint_use_global = 0
let g:ale_typescript_tsserver_config_path = ''
let g:ale_typescript_tsserver_executable = 'tsserver'
let g:ale_typescript_tsserver_use_global = 0
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_lint_on_insert_leave = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_list_window_size = 10
let g:ale_list_vertical = 0
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = {}
let g:ale_pattern_options_enabled = 0
let g:ale_set_balloons = 1
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(executable check - failure) eslint
(executable check - success) [project_path]/node_modules/.bin/tslint
(started) ['/bin/bash', '-c', 'cd ''[project_path]/src'' && ''[project_path]/node_modules/.bin/tslint'' --format json -c ''[project_path]/tslint.json'' ''/tmp/v2oIbDL/5/index.ts''']
(started) ['/bin/bash', '-c', '[project_path]/node_modules/.bin/tsserver']
(executable check - failure) typecheck
(executable check - failure) eslint
(finished - exit code 127) ['/bin/bash', '-c', 'cd '[project_path]/src'' && ''[project_path]/node_modules/.bin/tslint'' --format json -c ''[project_path]/tslint.json'' ''/tmp/v2oIbDL/6/index.ts''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) typecheck
(executable check - failure) eslint
(finished - exit code 127) ['/bin/bash', '-c', 'cd ''[project_path]/src'' && ''[project_path]/node_modules/.bin/tslint'' --format json -c ''[project_path]/tslint.json'' ''/tmp/v2oIbDL/7/index.ts''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) typecheck
(executable check - failure) eslint
(finished - exit code 127) ['/bin/bash', '-c', 'cd ''[project_path]/src'' && ''[project_path]/node_modules/.bin/tslint'' --format json -c '[project_path]/tslint.json'' ''/tmp/v2oIbDL/8/index.ts''']

<<<NO OUTPUT RETURNED>>>

(executable check - failure) typecheck

@jaalzateolaya
Copy link
Author

I'm going to try deleting all the plugins and reinstalling them.

@jaalzateolaya
Copy link
Author

Reinstalling everything didn't work.

@jaalzateolaya jaalzateolaya changed the title TSLit exits with error code 127 (Command not found?) TSLint exits with error code 127 (Command not found?) Jun 20, 2018
@w0rp
Copy link
Member

w0rp commented Jun 20, 2018

I tried cloning that project and checking the files inside it with tslint installed to node_modules. It seems to work for me. If you can create an example project with a configuration that repeats the bug, let me know, and I can test with that.

@jaalzateolaya
Copy link
Author

jaalzateolaya commented Jun 27, 2018

Should be caused by something wrong in my settings?
alexander-alzate/dotvim-settings

@w0rp
Copy link
Member

w0rp commented Jun 27, 2018

I'm not sure myself.

@jaalzateolaya
Copy link
Author

I managed to get this error from the job running the linter:

/usr/bin/env: ‘node’: No such file or directory

Its because I'm using nvm...

@w0rp
Copy link
Member

w0rp commented Jun 28, 2018

Aha, that makes more sense. Maybe there's a way ALE could detect if nvm is being used, and run scripts via nvm instead.

@jaalzateolaya
Copy link
Author

jaalzateolaya commented Jun 28, 2018

Setting up shellcmdflag=-lc on vimrc fixes the problem.

The -l or --login make bash act as if it had been invoked as a login shell, which means loading .bash_profile

@w0rp
Copy link
Member

w0rp commented Jul 1, 2018

Okay, I guess you must have needed some kind of environment variable set in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants