[Pkg-javascript-devel] npm debian package

Jérémy Lal jerry at edagames.com
Thu Oct 6 21:18:11 UTC 2011

Thank you for your answers,
here is what i propose that would fit :

On 06/10/2011 19:28, Isaac Schlueter wrote:
> 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.

patching node just to fix this was a bad idea anyway.

> 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
The debian package must distribute npm executable in /usr/bin/npm,
or else it won't be accepted. That does not prevent npm from reigning
over /usr/local/{bin,lib/node_modules,share/man}

> 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}
That's not what i meant at all.
npm-g can do whatever it wants to /usr/local/*
Anyway please read below.
> 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.

Here's what i propose for a minimal change to npm, that makes it possible to
be installed and used 100% as intended :

if `which npm` is /usr/bin/npm, let npm find /etc/npmrc as the global config;
instead of /usr/etc/npmrc, which is a non-standard place to put a config file.
Same goes for /usr/etc/npmignore, but having /etc/npmrc is enough : the npm
debian package will distribute /usr/bin/npm along with /etc/npmrc containing at least

It would be fantastic we could agree upon that.


More information about the Pkg-javascript-devel mailing list