Fails to Run
Closed this issue · 5 comments
I typed:
call JsBeautify()
And received this message:
Error detected while processing function JsBeautify[1]..Beautifier:
line 54:
E484: Can't open file /var/folders/b6/ywfrqgxn4y313snw1mt385200000gn/T/v9E5lEa/2
That last folder does not exist, probably because of the failure that caused the message. I'm on a Mac and installed using Vundle. Any ideas?
@cwingrav interesting
Did you run command Update git submodules: cd ~/.vim/bundle/vim-jsbeautify && git submodule update --init --recursive
?
I ran this command. There was no output on the terminal, errors or success otherwise. It returned an error code of 0 (via echo $?). I then retried the :call JsBeautify() and received a similar error message.
Any other ideas? It says line 54. Which file? Maybe I can poke around.
@cwingrav Thanks!
This strange file path look like a path of tmp file - https://github.com/maksimr/vim-jsbeautify/blob/master/plugin/beautifier.vim#L25
You can check it running command :echo g:tmp_file_Beautifier
.
You can set custom path for tmp file g:tmp_file_Beautifier='/tmp/foo'
, but it's strange that it does not work because I also use macOS and all work fine
P.S.
Maybe does not work write - https://github.com/maksimr/vim-jsbeautify/blob/master/plugin/beautifier.vim#L399 for example you don't have permissions on folder where tmp file should be created
Definitely something with file permissions. My machine was recently installed so there aren't a lot of weird or lingering configuration settings. If you know which file is erring out on line 54, that's probably the best bet.
If I 'touch' the next file to be created (ex. '2' in my first post), then it runs without errors, but does not update the file contents in the vim editor.
I changed the tmp_file_Beautifier and it didn't help.
I don't know either. Bummer. Thanks for the help anyway though.
@cwingrav ok,
Maybe this answer on stackoverflow - http://stackoverflow.com/a/19704129/1620380 - will be useful.