Installed node modules globally but still showing error
suppose you installed a node module X-module
globally somehting like this node i -g X-module
but still getting error when you call that module. Then you might be having NODE_PATH not pointing to your modules. To solve the problem try the following method.
Write your command to install node module globally.check
node i -g X-module
check out the path where the module is installing. In my case it was /usr/local/lib/node_modules/
. copy this path.
write following command in terminal.
echo NODE_PATH=your_node_module_path > ~/.bashrc
source ~/.bashrc
Hope it helped you out :)