vimr
vimr copied to clipboard
"node" is not executable
Hi guys,
Just learned about this project, and having lived in tmux for quite some time I thought I wanted to test it out, however opening Vimr gives me the following error:
[coc.vim] "node" is not executable, checkout https://nodejs.org/en/download/
Some information:
Vimr: Version 0.34.0 (355) (from brew cask)
$ which node
/Users/crs/.asdf/shims/node
$ node -v
v13.8.0
I have all my bins in my path, and have my (n)vim setup running in a terminal where :checkhealth does not complain about any provider – it seems like Vimr does not look in my shims path, even though its in my $PATH.
Am i missing anything, or does Vimr not like asdf?
try initialize asdf in $HOME/.zshenv e.g.
. /usr/local/opt/asdf/asdf.sh
try initialize asdf in $HOME/.zshenv
e.g.
. /usr/local/opt/asdf/asdf.sh
That I already have. Otherwise asdf does not work. Everything works, except in this application.
It works for me and it's suggested by vimr.
BTW, check "Use interactive mode for zsh" does not work and the state will not be saved.
I have a similar problem with nvim-lspconfig. It works fine in normal NVIM, but cannot find things in VimR.
if you :!node and see node command not found, but you can run node in your zsh/bash/..any shell, that's because the MacOS GUI program (not only vimr) does not respect and load environment variables you set (not only PATH, include PATH of course) in your .zshrc/.bashrc .. any shellrc, node command not found in vimr occurs when your node does not installed in /usr/bin/; /usr/local/bin .. those PATH components your OS use as system-wide environment, for example, if you install node with nvm, your node normally exists in ~/.nvim/versions/node/.../bin. so, to be able to run !node in your vimr, the simplest solution is to include this path in your OS's system-wide PATH environment variable. in Big Sur, simple run "sudo echo '~/.nvim/versions/node/<YOUR_NODE_VERSON>/bin' > /etc/paths.d/node", then you could find "!node" run well in vimr. (Dont' know why the text above dispalyed with through-line)
Thanks @cnshsliu, I had the same issue and your solution fixed it; I learned about /etc/paths.d too. 🙂
Here's the one-liner that fixes the issue regardless of where node is installed:
sudo sh -c 'echo $(dirname $(which node)) > /etc/paths.d/node'