How to make Vim recognize the $PATH of a Node.js installation?

794 views Asked by At

I'm trying ot get Vim to recognize the $PATH of my Node.js installation:

/home/alex/nvm/v0.8.8/

(I installed node via NVM).

But each time I try to call node or any node-related command:

echo system('/home/alex/nvm/v0.8.8/bin/jshint --config /home/alex/.jshintrc /home/alex/www/coffeescript/js/script.js')

I get this:

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

I'm not very sure what's happening here but I think Vim is looking for node in the wrong directory. Is there any way to fix this?

Should I add node's base directory to the $PATH, or use a symlink? How to do that properly? (I'm not very familiar with dealing with $PATH).

1

There are 1 answers

0
Aaron Dufour On BEST ANSWER

You most likely want to make a symlink to node from somewhere on your path. /usr/bin would be a good choice. You could do this with:

ln -s /home/alex/nvm/v0.8.8/node /usr/bin/node

Assuming that node is at /home/alex/nvm/v0.8.8/node. I'm not very familiar with nvm; it might be deeper in that directory or named something else.