[Pkg-javascript-devel] nodejs: /usr/local on default global module paths ?

Jérémy Lal kapouer at melix.org
Thu Jun 21 21:54:44 BST 2018


Hi,

bug #901474 asks the question of wether having nodejs load
modules found inside /usr/local (share for pure js, lib for addons)
is something to be expected by default or not.

Anyone can already set NODE_PATH env variable, in a somewhat
compatible way with other environments, to set a preferred path for modules.
However, as
/usr/share/doc/nodejs-doc/api/modules.html#modules_loading_from_the_global_folders
put it,
"Sometimes deployments that rely on NODE_PATH show surprising behavior when
people are unaware that NODE_PATH must be set."
Same remark goes for whatever paths Debian may add to global modules search
directories.

There is, however, DFHS and debian practices.
It is undiscutably needed to shift modules paths into two places:
/usr/share/nodejs for pure javascript modules
/usr/lib/<triplet>/nodejs for c++ addons

I'm much less convinced that it is a good idea to add corresponding
/usr/local
paths to default global module paths.

How other languages deal with this ? (python, go, ruby, perl...)

Jérémy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20180621/9395c9bb/attachment.html>


More information about the Pkg-javascript-devel mailing list