Configure nvm to work properly with npm and grunt
I'm a bit new to web application development and going through Yeoman tutorial, which uses yo
, grunt
, bower
and angular
.
I used homebrew to install node
and npm
, but kept getting errors with npm
some permissions and whatnot. I deleted node
using brew
and instead used nvm
to install node
and npm
which no longer gives me the error.
BUT, nvm
somewhat annoying. I understand that this is a version manager node
and I don't care what every time I open the shell I have to nvm use 0.10
. But now when I want grunt serve
my web app from a new shell, I need to install grunt-cli:
nvm use 0.10
npm install -g grunt-cli
# ...
grunt serve
Is it grunt-cli
not installable globally? Or is it pointless, because it npm
doesn't "stick" between different shells?
Basically I'm fine just using one version of node right now. How do I configure nvm
, npm
and grunt
so I don't have to re-install grunt
every time I open a new shell?
Instead of using nvm, use every time you can leave the .nvmrc file
As from the docs :
echo "0.12" >> .nvmrc
Now, the next time you enter this directory, nvm will read this file and download that particular version.
You can check if it works with
nvm use