[Pkg-javascript-devel] npm debian package

Isaac Schlueter i at izs.me
Thu Oct 6 17:28:07 UTC 2011


Patching node won't do the trick.  npm finds the real actual location
of the node executable in the path using the `node-which` library.
This is to prevent installing into some buried place like
/usr/local/Cellar/node/0.4.12/exec/lib/node_modules when node is
symlinked out of there to /usr/local/bin/node.

I'd definitely recommend configuring npm to live someplace where you
can allow it to have full reign over the global install space.  It
won't ever do anything outside its global "prefix" config (or the
local package for non-global installs).

It appears that this is the set of constraints:

1. global config *must* be /etc/npmrc
2. `which npm` *must* be /usr/local/bin/npm
3. npm source *must not* be patched in any dramatic manner
4. npm global installs *must* still work, but *must not* write
directly in /usr/local/{bin,lib/node_modules,share/man}

I would much rather use npm's extensive configuration options to
accomplish this, and not make any changes to the source itself.  If
there's some reason you can't do this with the ~/.npmrc or the
<prefix>/etc/npmrc files, then let's talk about what npm needs to
change to support this use case.

> Also you did not explicitely answer my question about
> "node_modules that would better be inside the tarball instead of packaged apart" :
> none, all, or no opinion ?

They should be bundled with npm, and are included in the tarballs on
registry.npmjs.org.

--i



More information about the Pkg-javascript-devel mailing list