Syntastic: jshint not loading to syntastic abnormal termination

Created on 26 Mar 2015  路  11Comments  路  Source: vim-syntastic/syntastic

recently I switched to use node with 'nvm', installed jshint set my vimrc like this

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_jshint_exec = '/home/user/.nvm/versions/node/v0.12.1/bin/jshint'

When opening vim now i get this and jshint is never loaded

syntastic: error: checker javascript/jshint: can't parse version string (abnormal termination?)

Most helpful comment

I have the same probem. I am running ubuntu and installed npm.
When running jshint without arguments on the console, I get this exception:

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

When installing nodejs on ubuntu, the binary gets named nodejs not node
Locally, I fixed it by creating a node symlink:

sudo ln -s /usr/bin/node{js,}

I understand that this is not the fault of syntastic, but I did not find this hint anywhere else.

All 11 comments

Please open a JavaScript file, set g:syntastic_debug to 32, run :SyntasticInfo, run :mes, and post the output.

yeah sorry i found a workaround and now it works. I tried to roll back to where it was before but it is not erroring out anymore.

The workaround is to install a copy of node's binaries the normal way and use that one instead of the nvm one.

I tried to remove the installed copy rollback to use nvm but now is not crashing anymore.

It might be a problem with the way/order i installed thing.

thanks, anyway

Once again, for people searching the archives: in the vast majority of cases, "abnormal termination" is a symptom of a problem outside syntastic.

I had the same problem using nvm and solved adding the following to my .vimrc:

if $PATH !~ "\.nvm"
    let $PATH="/home/services/.nvm/versions/node/v0.12.2/bin:" . $PATH
endif

I have the same probem. I am running ubuntu and installed npm.
When running jshint without arguments on the console, I get this exception:

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

When installing nodejs on ubuntu, the binary gets named nodejs not node
Locally, I fixed it by creating a node symlink:

sudo ln -s /usr/bin/node{js,}

I understand that this is not the fault of syntastic, but I did not find this hint anywhere else.

I also had this problem, and it seems to be because my jshint (version 2.9.2 from npm) outputs jshint v2.9.2 in response to --version. I made a wrapper as a quick fix (obviously it would be better to actually parse the version than hard-code it).

#!/bin/sh

if [ "$1" = '--version' ]
then
  echo 2.9.2
else
  jshint "$@"
fi

I can't help but wonder if this is a common problem. Would it be a good idea to have an universal way skip the version check, and leave the user responsible to ensure they have the needed versions of checker programs? Or make the version parser more lenient, and ignore everything except numbers and dots?

@hagabaka No, the output of v2.9.2 is not a problem for syntastic, I have syntastic working fine with the exact same version of jshint. Trying to run jshint not installed globally might be a problem though. Or the problem might be something completely unrelated.

Please open a new issue, and state (1) your OS and your Vim version, (2) what you did, (3) what did you expect to happen, and (4) what happened instead. Open a JavaScript file, run :SyntasticInfo, and post the output. Then set g:syntastic_debug to 3, run :SyntasticCheck jshint, run :mes, and post the output.

@lcd047 The output for me is jshint v2.9.2, not just v2.9.2.

@hagabaka Syntastic can still parse jshint v2.9.2:

:echo syntastic#util#parseVersion('jshint v2.9.2')
[2, 9, 2]

As I said, your problem is elsewhere.

I had the same problem with jsxhint,

Doing this solved my problem:

--- a/syntax_checkers/javascript/jsxhint.vim
+++ b/syntax_checkers/javascript/jsxhint.vim
@@ -23,7 +23,8 @@ function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict " {{{1
     endif

     let version_output = syntastic#util#system(self.getExecEscaped() . ' --version')
-    let parsed_ver = !v:shell_error && (version_output =~# '\m^JSXHint\>') ? syntastic#util#parseVersion(version_output) : []
+"    let parsed_ver = !v:shell_error && (version_output =~# '\m^JSXHint\>') ? syntastic#util#parseVersion(version_output) : []
+    let parsed_ver = [2, 9, 2]
     if len(parsed_ver)
         call self.setVersion(parsed_ver)
     else

Don't know why but bypassing version parsing did solved the problem.

@mannyhappenings That hides the problem rather than solve it. _shrug_

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lemeb picture lemeb  路  6Comments

noprompt picture noprompt  路  5Comments

PROgram52bc picture PROgram52bc  路  6Comments

duckpuppy picture duckpuppy  路  8Comments

jasonkuhrt picture jasonkuhrt  路  8Comments