Closed tunnckoCore closed 8 years ago
But that's not related this project is it? This provides the default paths used by npm.
Get the npm global path prefix. Same code used internally by npm
Hm. That's okey, but custom prefix again is global prefix, lol. It is lil' bit.. hm.
To me it is logical when npm support custom prefix, this one also to support it and almost worth nothing. It would help for better resolving global modules, imo.
I have few libs that depends on that module - get-installed-path
, detect-installed
and is-installed
.
Also this package is used in global-modules
which is with pretty clear description "the directory used by npm for globally installed npm modules."
so, should there be another lib called custom-prefix
that uses a custom prefix if defined and falls back to global-prefix?
but custom prefix again is global prefix,
but, if I recall correctly that logic is handled by npm outside of the global prefix logic.
fwiw, I'm not necessarily opposed to adding logic for custom prefix. it depends on how much overhead it adds
another lib called
custom-prefix
that's maybe the easiest way, but less meaningful and logical. maybe some other name at least, idk.
if I recall correctly that logic is handled by npm outside of the global prefix logic.
hm.. good point.
@tunnckoCore can you check and see if this works for you now?
I believe it worked before #8 or I may be wrong, but nevermind. I'll try asap, because i'm busy with university.
because i'm busy with university.
don't worry about this! university is much more important than this
Ok closing based on the assumption that it's working for you. If necessary we can reopen
Yep, works in first glance. :) Sorry for the delay.
Currently in my Arch i set it to
/usr/local
, because default installs of node and npm uses/usr
. One way could be usingrequire('rc')('npm').prefix
(pretty faster and easier than spawnSync) and then fallback toprocess.execPath
andDESTDIR
or if you want npm-prefix, but I don't like it that it does
../../
thing.