I've setup a python virtualenv using virtualenvwrapper. After setup, it seems that node programs are still running from the global installs instead of using virtualenv versions.
Steps:
Create a virtualenv named "env"
mkvirtualenv env
Activate virtualenv
workon env
Install nodeenv
pip install nodeenv
Install node.js and add nodeenv shell functions to virtualenv
nodeenv -p
Deactivate and reactivate virtualenv (tried with ...env/bin/source activate too)
Test node.js path (gives correct path inside virtualenv)
which node
Install stuff
npm install -g yo grunt-cli bower
Test paths (shows my global path: /home/USER/.node/bin/grunt)
which grunt
The directory "node_modules" get's created in the directory that I run the npm install command from, but as I mentioned before, when I check the working path to each node program it is the global path instead of inside the virtualenv like node.js. This is causing problems too, for example Yeoman complains when it is installing that '[Error] npm root value is not in your NODE_PATH' and then even though it says it successfully installed a generator, the generator doesn't show up in the list (this is all still inside the virtualenv).
Outside the virtualenv I'm able to use node.js programs fine.
This thread seems similar but didn't help me out: nodeenv -- not linking grunt when installed via npm install -g?
Any help would be much appreciated!