This is a relatively hacky solution, but simplest one that works, so writing it down for my own reference. If the Grunt plugin was aware of nvm (or configurable to use a custom environment before launching the "grunt" command) this would be a LOT easier, but if such config options exist I'm unaware of them. Also note that this will NOT switch your node
version dynamically between projects as nvm
would.
To link your current node as the global one:
$ sudo ln -s $(which node) /usr/bin/node
$ sudo ln -s $(which npm) /usr/bin/npm
Then you'll need a global grunt-cli
so that the Grunt plugin can find it, and any gems your build process may use (mine needs compass
, and the Grunt plugin is no more aware of rvm
than nvm
). Make sure you're in a terminal where you're using the aforementioned global npm
and global ruby
(confirm with which npm
etc):
$ sudo npm install -g grunt-cli
$ sudo gem install compass --version 0.12.2
The same restrictions apply (that is, no automatic switching between projects) for both grunt-cli
and compass
.
IDEA et al also contain a Terminal tab, which is a handy way to drop back into the CLI when the git
or grunt
integrations don't cut it. In that terminal you CAN use nvm
and nvm
as usual, but at least I had to go and set:
Preferences -> Terminal -> Shell path
to
/usr/local/bin/bash --rcfile ~/.bashrc