MY SITUATION
I have installed version Node v6.2.0 using n on Ubuntu 14.04. It's located under path /usr/local/n/versions/node/6.2.0 (by using npm prefix -g).
My global packages installs in that directory under lib/node_modules but I can't use that packages from command line globally.
NOTE Earlier I was using older version Nodejs 5 installed different way. And packages installed globally with that version of Node are available now, but not new ones which I installing now.
MY QUESTION
Is there a trick or something to point node_modules directory from which its packages could be used globally?
Your global package binaries should be available here:
Add it to your path (in
.bashrc
or.bashprofile
or.zshrc
):Then restart your console or just run
source ~/.bashrc
Also, if you're working with multiple versions of node, I highly recommend nvm for installing and managing them.