Closed german1608 closed 6 years ago
Where have you installed standard
?
in my node_modules/
directory of my project.
Does the executable exist in node_modules/.bin/standard
, or in another location?
Yes. The executable is in the node_modules/.bin/
folder:
Where is the file you are editing in the relation to your node_modules
directory, and can you execute standard
from node_modules?
The main file and the directory where are more files are both siblings of node_modules
.
ls
node_modules/ test/(here are more js files) index.js package.json ....
You mean by executing ./node_modules/.bin/standard
? Yes
After you pull from master, what do you get from :ALEInfo
? Do you see any executable checks being done, or commands being run?
Current Filetype: javascript.jsx
Available Linters: ['eslint', 'flow', 'jscs', 'jshint', 'standard', 'xo']
Enabled Linters: ['standard']
Linter Variables:
let g:ale_javascript_standard_executable = 'standard'
let g:ale_javascript_standard_options = ''
let g:ale_javascript_standard_use_global = 0
Global Variables:
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%s'
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_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {'javascript': ['standard']}
let g:ale_open_list = 0
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_offset = 1000000
let g:ale_sign_warning = '--'
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - failure) standard
(executable check - failure) standard
(executable check - failure) standard
(executable check - failure) standard
I just installed it globally and now works! Thanks for your help anyway!
I'll see if I can figure out what the problem is here later and fix it. You shouldn't have to install standard
globally.
Yeah you're right. I'll tell you anything that happens. I'll maybe uninstall it (globally) and install it (locally like a dependency) of my project. But right now I'm happy with it. Thanks! (if you want don't close the issue till something happens again)
I tried creating a new directory and installing standard with yarn add standard
, and it worked. Are you working on a React app by chance? I know that there are some scripts which install some files to different locations for React. Maybe opening node_modules/.bin/standard
will provide some clues.
I'm not using React in that project. I installed standard
via npm
.
I just uninstalled it globally and now doesn't work. I tried with another project that has standard
installed but also doesn't works.
Leave it installed globally so it works for you.
I recommend checking out the contents of node_modules/.bin/standard
. That might give you some clues as to why the file isn't executable.
That file is a link and there are the content of that file
These are the contents of option.js
And here is a pastebin of the source code of node_modules/standard-engine/bin/cmd.js
(required at standard
file)
I'll take a look by myself to those files. But here I left them to you if you see something first
Pull ALE again. I just pushed a commit to prefer executing node_modules/standard/bin/cmd.js
instead.
Same. I uninstalled standard globally and same happens. I tried reinstall it locally but same
THis is the output of :ALEInfo
Current Filetype: javascript.jsx
Available Linters: ['eslint', 'flow', 'jscs', 'jshint', 'standard', 'xo']
Enabled Linters: ['standard']
Linter Variables:
let g:ale_javascript_standard_executable = 'standard'
let g:ale_javascript_standard_options = ''
let g:ale_javascript_standard_use_global = 0
Global Variables:
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%s'
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_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {'javascript': ['standard']}
let g:ale_open_list = 0
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_offset = 1000000
let g:ale_sign_warning = '--'
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - failure) standard
(executable check - failure) standard
(executable check - failure) standard
(executable check - failure) standard
Hmm, I'm not sure. The executable checks there are still there for just standard
. Could you create a project which repeats the bug and put that on GitHub somewhere? A zip file would do fine as well, etc. Let me know what environment you're running Vim, such as your Linux distribution, or other OS version. I'll take a look at that later and see if I can see anything wrong.
Ok. I'm using ubuntu 16.04. vim 8.0. I just create a new project and installed standard
but nothing happens. It doesn't work. Here is a zip file of the project that I created (it includes node_modules/
dir). I pulled ALE before testing everything.
What version of npm do you have? I'm using 3.10.1 . Maybe it's that idk
I have 4.2.0
, but I use yarn
, and whatever the latest version of that is.
same issue here, for me it does not work when I've installed standard globally.
Installing it in the project does the trick though..
Tried adding this, but to no avail
let g:ale_javascript_standard_use_global = 1
Edit: figured it out
let g:ale_javascript_standard_executable='/path/to/global/standard'
I'm also having trouble with standard
, though not sure if this is the exact same problem...
My ALEInfo
output:
Current Filetype: javascript.jsx
Available Linters: ['eslint', 'flow', 'jscs', 'jshint', 'standard', 'xo']
Enabled Linters: ['standard']
Linter Variables:
let g:ale_javascript_standard_executable = 'standard'
let g:ale_javascript_standard_options = ''
let g:ale_javascript_standard_use_global = 0
Global Variables:
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_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
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_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {'javascript': ['standard']}
let g:ale_open_list = 0
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_offset = 1000000
let g:ale_sign_warning = '--'
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) /Users/A780976/personalDev/farm-web-app/node_modules/standard/bin/cmd.js
(started) ['/bin/zsh', '-c', '''/Users/A780976/personalDev/farm-web-app/node_modules/standard/bin/cmd.js'' --stdin ''/Users/A780976/personalDev/farm-web-app/src/App.js'' < ''/var/folders/qc/t8d0jpy13mq9j36cgl253vh80000gp/T/nvimukxGj8/3/App.js''']
(finished - exit code 127) ['/bin/zsh', '-c', '''/Users/A780976/personalDev/farm-web-app/node_modules/standard/bin/cmd.js'' --stdin ''/Users/A780976/personalDev/farm-web-app/src/App.js'' < ''/var/folders/qc/t8d0jpy13mq9j36cgl253vh80000gp/T/nvimukxGj8/4/App.js''']
<<<NO OUTPUT RETURNED>>>
(finished - exit code 127) ['/bin/zsh', '-c', '''/Users/A780976/personalDev/farm-web-app/node_modules/standard/bin/cmd.js'' --stdin ''/Users/A780976/personalDev/farm-web-app/src/App.js'' < ''/var/folders/qc/t8d0jpy13mq9j36cgl253vh80000gp/T/nvimukxGj8/5/App.js''']
<<<NO OUTPUT RETURNED>>>
The standard executable seems to be fine:
$ ls -al node_modules/.bin/standard
lrwxr-xr-x 1 A780976 staff 22B Nov 18 21:47 node_modules/.bin/standard -> ../standard/bin/cmd.js
For context, I also have standard
installed globally:
$ which standard
/Users/A780976/.nvm/versions/node/v8.9.1/bin/standard
via nvm
I have tried adding the
let g:ale_javascript_standard_use_global = 1
variable in my ~/.config/nvim/init.vim
, but it has had no effect.
Would appreciate any help!! This is the last big piece of my vim
--> neovim
migration :)
Try and use the local version if you can, so it will be updated along with your other packages. What's the problem?
@w0rp So there are 3 errors in the file:
$ standard src/App.js
standard: Use JavaScript Standard Style (https://standardjs.com)
standard: Run `standard --fix` to automatically fix some problems.
/Users/A780976/personalDev/farm-web-app/src/App.js:4:19: Extra semicolon.
/Users/A780976/personalDev/farm-web-app/src/App.js:9:22: Unexpected usage of doublequote.
/Users/A780976/personalDev/farm-web-app/src/App.js:10:27: Unexpected usage of doublequote.
These never show up in ALE. Rather, the debug output seems to show NO OUTPUT RETURNED
My bet is on some sort of PATH
problem related to nvm
Problem solved!
Turns out it was a PATH
problem after all. For zsh
users, note that:
.zshrc
is run after .zshenv
Run your nvm.sh
setup script at the bottom of .zshrc
.
Sorry for the problem! Clearly had nothing to do with ALE
.
I had a simular problem to juliankatz1991
The debug output shows \<<NO OUTPUT RETURED>>
The error was traced in my code from running
standard src/app.js
/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/node_modules/pkg-conf/node_modules/parse-json/index.js:31
throw jsonErr;
^
JSONError: Unexpected string in JSON at position 664 while parsing '{ "name": "application-name", "versi' in package.json
at module.exports (/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/node_modules/pkg-conf/node_modules/parse-json/index.js:26:19)
at parse (/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/node_modules/pkg-conf/node_modules/load-json-file/index.js:8:29)
at Function.module.exports.sync.fp [as sync] (/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/node_modules/pkg-conf/node_modules/load-json-file/index.js:11:29)
at Function.sync (/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/node_modules/pkg-conf/index.js:52:27)
at Linter.parseOpts (/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/node_modules/standard-engine/index.js:140:15)
at Linter.lintFiles (/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/node_modules/standard-engine/index.js:94:15)
at Object.Cli [as cli] (/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/node_modules/standard-engine/bin/cmd.js:99:14)
at Object.<anonymous> (/home/chad/.nvm/versions/node/v8.9.1/lib/node_modules/standard/bin/cmd.js:7:30)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
I recently installed ALE via pathogen and I don't know why my
standard
linter doesn't work. I used theg:ale_linters
option to specifystandard
as my linter for javacript. But It just doesn't work.If I dont' set that variable, all linters are enabled but the only one that works is
jshint
. Here is the output of :ALEInfo