Setting up paths in Sublime with NVM

environment-variables, macos, node.js, nvm, sublimetext2

Solution

New Answer for 2020!

You can now add the following one-liner to your `.bashrc`, `.zshrc`, etc.

export NVM_SYMLINK_CURRENT=true

Then, anywhere you need your node path, it's always in the same place:

~/.nvm/current/bin/node

#OR

$HOME/.nvm/current/bin/node

Further reading: https://medium.com/@danielzen/using-nvm-with-webstorm-or-other-ide-d7d374a84eb1

Problem

I am using NVM as my node version manager on OSX, which is great except that it creates multiple problems with my IDE. I am using Sublime Text and most of the plugins that I have ever used look for nodejs at `/usr/local/bin` and since I am using NVM node is obviously not available at that location, instead available at `/Users/${User}/.nvm/${NodeVersion}/bin/node`. I have an option of updating the path of nodejs in that plugin's configuration but then when I install another plugin I have to do the same thing. Same applies to using CoffeeScript, LESScss etc. Moreover when I update my node version via NVM, I have to update the paths in all the configs again. NVM has quite essentially created more problems while trying to solve one for me. UPDATE: After a very long time I was able to finally resolve the problem using isaacs brilliant solution - nave. The `nave usemain stable` command, is just enough to understand you sentiments :)

Original source

Related problems