Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个构建环境,其中我的库(和头文件)安装到自定义位置。从 npm 安装包时,使用 node-gyp 的模块会失败,因为它们找不到我安装的库(或标头)。如何让 node-gyp 知道我的自定义安装位置(linux)?
如果您在同一行中设置CXXFLAGS和LDFLAGS之前npm install <pkg>,它似乎工作:
CXXFLAGS
LDFLAGS
npm install <pkg>
$ CXXFLAGS=-I/path/to/include LDFLAGS=-L/path/to/lib npm install <pkg>
或者,您可以在npm install
npm install
$ export CXXFLAGS=-I/path/to/include $ export LDFLAGS=-L/path/to/lib $ npm install <native-package>