vimr icon indicating copy to clipboard operation
vimr copied to clipboard

"node" is not executable

Open casperstorm opened this issue 3 years ago • 6 comments

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?

casperstorm avatar Sep 04 '20 12:09 casperstorm

try initialize asdf in $HOME/.zshenv e.g.

. /usr/local/opt/asdf/asdf.sh

egolearner avatar Sep 16 '20 06:09 egolearner

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.

casperstorm avatar Sep 16 '20 08:09 casperstorm

It works for me and it's suggested by vimr. image BTW, check "Use interactive mode for zsh" does not work and the state will not be saved.

egolearner avatar Sep 16 '20 11:09 egolearner

I have a similar problem with nvim-lspconfig. It works fine in normal NVIM, but cannot find things in VimR.

pusewicz avatar Jan 07 '21 12:01 pusewicz

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)

cnshsliu avatar Jan 24 '21 15:01 cnshsliu

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'

banjerluke avatar May 18 '21 22:05 banjerluke