-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the dev installation directory configurable (~/.node-gyp) #21
Comments
Could probably add a |
I'd suggest just using |
Getting hit by this because I'm behind a proxy which doesn't allow |
@apaprocki This option would still require you to download node header files, this would just be where to store them. I think what you're looking for is the |
@TooTallNate Yes, |
@apaprocki Ok I see what you mean now. Yes, could do what you are describing with this proposed |
suggest detecting NODE_ROOT variable in env variables as nodeDir when there's no --nodedir
then we don't need to configure with --nodedir every time |
@TooTallNate: what do you think of @mindon's proposal? I can send a pull request... We'd appreciate this change here at Facebook. Our build process is pretty crazy. Being able to set an environment variable is preferable to a flag for us because npm defaults to |
@TooTallNate: Any news on this? I just hit this problem while building native modules against my custom headers, if there is something like |
The --nodedir flag is there On Tuesday, February 19, 2013, Cheng Zhao wrote:
|
Oops, I meant |
Well you can kinda hack it at the moment by setting the |
I love the way npm handles config params: Same values can be set via flags, env vars, per-user files, global files, builtins set by ./configure params, and defaults. It even provides commands a script can use to create and populate the config files (which is what I ended up doing, but I could have also set up vars or managed the configs in version control). Wish more software were so flexible in this regard. I'm putting together a build process that wraps a large collection of various software packages. node/npm was a breeze because of its flexible options. Right now node-gyp is sticking out like a sore thumb because of the ~/.node-gyp directory it's leaving behind when I don't want anything in $HOME. |
Hey, just wanted to mention that I'm installing bcrypt as part of a user-data script on Amazon EC2, which uses node-gyp to compile some binaries. However, because node-gyp expects either
I was able to resolve this by defining |
👍 npm's cache config is along the lines of what I'd expect here: https://npmjs.org/doc/cli/npm-cache.html#CONFIGURATION (Context: persistent node-gyp cache on Heroku between builds.) |
We'd like our build boxes to be self-contained from external systems, and that includes nodejs.org. We can easily package up the node headers alongside our package of node, but we don't have any way of configuring node-gyp to using it, short of symlinking in ~/.node-gyp, which is a bit dirty. I'd would be happy with setting an ENV variable that sets the node header path. |
I would suggest following the XDG base directory spec AFAIK, everything in |
- Allows users to specify development directory using '--dev-dir' flag - Added check for XDG_CACHE_HOME before HOME
Until you guys decide, it'll be great if you offer an environment variable or npm style config, e.g. cache = ${XDG_CACHE_HOME}/node-gyp :) |
where are we with this issue??. Dont meant to brag, but the discusion started in 2012 :-) and there is PR |
Having an env-var as @mindon suggested would be useful for me as well. Not clear how to adjust the way npm calls node-gyp. |
…the real HOME See nodejs/node-gyp#21 for some details
@TooTallNate echoing @jmesmon I don't know of a good way to change how npm calls node-gyp for me to add the ninja-edit: Per npm-install this can be done by passing |
@terinjokes You can pass |
@bnoordhuis I had just edited my comment to point that out. |
Does npm support |
It should. npm passes on options it doesn't consume itself. |
Since electron-builder 18.4.0 ugly solution HOME env will be not used anymore. Because in this case cache dir is doubled (yarn and npm have to download and cache deps twice). Thanks! |
never ended up figuring out how this works - I suppose I might dig into the code someday... these were the steps, expecting node 8.9.1 with npm 5.5.1 executing @jasonkarns fyi, for me, it doesn't seem like ~/.node-gyp is cache data - it's got include files and stuff to run applications, I suppose in XDG it would end up in XDG_DATA_HOME or something |
Lines 41 to 45 in 470f04e
found this issue while digging the source code on how it works. yeah, can we have a environment variable or something to move this folder? i don't want to keep this at my home folder and i've already moved almost anything in corresponding folders ($XDG_CONFIG_HOME, $XDG_CACHE_HOME and $XDG_DATA_HOME) |
@mighty9245 You should be able to use the |
oh, so it was implemented? sorry, looked through readme, source code and several posts in this issue since i'm not working with node-gyp and something that i built created this directory and i just wanted to prevent this in future. ok, i'll try that, thanks! |
- E302 expected 2 blank lines, found 1 - E711 comparison to None should be 'if cond is not None:' - E713 test for membership should be 'not in' - E721 do not compare types, use 'isinstance()' - E731 do not assign a lambda expression, use a def - E741 ambiguous variable name - F402 import shadowed by loop variable Co-authored-by: Christian Clauss <cclauss@me.com>
Not a real high priority to me, but 👍 if you want this feature.
The text was updated successfully, but these errors were encountered: