Skip to content
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

nodejs 'make install'ed headers are ignored #1191

Closed
soulne4ny opened this issue May 5, 2017 · 7 comments
Closed

nodejs 'make install'ed headers are ignored #1191

soulne4ny opened this issue May 5, 2017 · 7 comments

Comments

@soulne4ny
Copy link

node's build process installs headers in {prefix}/include/node when running make install, but node-gyp install does download its own copy almost the same. One of them is just an useless extra.

And ./configured headers are better tailored for the local environment usually.

@bnoordhuis
Copy link
Member

You can point it to the local headers with the --nodedir switch. node-gyp is not and cannot be made aware of them (reliably.)

And ./configured headers are better tailored for the local environment usually.

Not with node, it doesn't matter whether it uses the local ones or the downloaded ones.

@soulne4ny
Copy link
Author

Neither npm nor yarn know anything about --nodedir.

@gibfahn
Copy link
Member

gibfahn commented May 12, 2017

Neither npm nor yarn know anything about --nodedir.

npm (and I assume yarn) pass on any arguments they don't understand to whatever they spawn, in this case node-gyp.

@soulne4ny
Copy link
Author

10x
Crazy, Rather unexpected.
Then, hypothetically, if npm would spawn 2 different commands echo requiring different command line flags during one run, both of them should break because it is usually what commands do with unknown flags...

@gibfahn
Copy link
Member

gibfahn commented May 13, 2017

Then, hypothetically, if npm would spawn 2 different commands echo requiring different command line flags during one run,

Maybe, I've never heard of that being an issue, but if you want to avoid it just set the environment variable or the npm config value (see #1185 for docs):

export npm_config_nodedir=/path/to/headers
# Or:
npm config set nodedir /path/to/headers

@soulne4ny
Copy link
Author

soulne4ny commented May 13, 2017

export npm_config_nodedir=/path/to/headers

Thanks 👍

@cor
Copy link

cor commented Aug 26, 2022

FYI: When we build this with nix, using nix-npm-buildpackage's buildNpmPackage we only faced this issue on aarch64 machines.

https://nixos.org/manual/nixpkgs/stable/ section 17.19.6.2.5. Pitfalls contains a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants