Reputation: 10153
I have a build environment in which my libraries (and headers) are installed to a custom location. When installing a package from npm, modules that use node-gyp fail because they cannot find the libraries (or headers) I've installed. How can I make node-gyp aware of my custom install location (linux)?
Upvotes: 6
Views: 2017
Reputation: 10153
If you set CXXFLAGS
and LDFLAGS
before npm install <pkg>
in the same line, it seems to work:
$ CXXFLAGS=-I/path/to/include LDFLAGS=-L/path/to/lib npm install <pkg>
Alternatively you can export the flags prior to the npm install
$ export CXXFLAGS=-I/path/to/include
$ export LDFLAGS=-L/path/to/lib
$ npm install <native-package>
Upvotes: 7