set node.js REPL module paths

I can't figure out how to add paths to my Node.js installation (v.0.4.7 on Mac OS X). I've installed npm, and it installs globally to /usr/local/lib/node_modules. However, when I installed npm, it didn't notify Node about where it chose to put global modules (should it have?). Now when I use Node in command-line mode, I can't simply require() my globally-installed modules. So, I'm wondering if there is some kind of Node configuration file or environment variable where I can add my global npm module installation path?

I know that I can just add it to the require.paths array when I'm in Node's command line, but I want to add this global module folder once and for all, so that Node will always search that directory for modules when I require() them from the command line. Thanks in advance for any help and pointers about making npm and Node co-exist!

19
задан ampersand 5 May 2011 в 05:27
поделиться