On Wed, Feb 26, 2014 at 3:45 PM, Tom Hughes tom@compton.nu wrote:
Am I going mad, or is there a bug that means node is no longer searching the global library directory by default?
node has never done this in Fedora proper. Whether or not you are going mad depends on whether you used my old repository and/or are used to Debian's behavior in this regard. ;-)
This is a deliberate design decision by node and npm upstream which Fedora respects. For more information on why, see: https://www.npmjs.org/doc/faq.html#I-installed-something-globally-but-I-can-...
Our packaging guidelines are intended to ensure that RPM-provided modules work exactly like ones installed by `npm install -g`, and can be used in local modules easily using `npm link`. You can also set NODE_PATH=/usr/lib/node_modules in your environment to make npm and rpm installed modules available universally.
This is also documented here: https://fedoraproject.org/wiki/Node.js#Using_modules_installed_via_yum
While node does have support for a global search path for historical reasons, upstream advises that it not be used. I did use it* for module packaging with my old repo, and people complained about it semi-frequently. Mostly because it makes it easier to forget to add dependencies to your package.json when you have modules from RPM require()able universally.
*Acutally node_modules and /usr/lib/node were symlinked together, which made npm install -g put stuff in the global search path, making it even more awful. :-(
-T.C.
[Sorry for the long explanation which probably says stuff you already know, but I've said this a dozen times in other venues so I wanted to repeat the whole spiel so it gets archived here too. :-)]