[{
location: 'france',
xxxx: true,
yyyy: false,
center: 'sales'
},
{
location: 'france',
xxxx: true,
yyyy: false,
center: 'sales'
}]
说:
node-gyp --help
但Usage: node-gyp <command> [options]
where <command> is one of:
- build - Invokes `make` and builds the module
- clean - Removes any generated build files and the "out" dir
- configure - Generates a Makefile for the current module
- rebuild - Runs "clean", "configure" and "build" all at once
- install - Install node development files for the specified node version.
- list - Prints a listing of the currently installed node development files
- remove - Removes the node development files for the specified version
node-gyp@1.0.2 /usr/local/lib/node_modules/node-gyp
node@1.8.1
实际记录在哪里?我已经选择了各种.js源文件来试图找出它并且没有任何结果。
[options]
只是传递给gyp吗?
具体来说,我试图使用未命名的绑定文件&#39; binding.gyp&#39;但它似乎是节点 - &gt;位于node.js和gyp之间的Python包装器由于某些硬编码而不允许它(尽我所知)。
例如:[options]
生成:
node-gyp configure custom.gyp
其中<snip>
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp', <-- NOT OK
gyp info spawn args 'custom.gyp', <-- OK
<snip>
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/node-gyp/custom.gypi', <-- MAYBE OK? DON'T LIKE IT BEING GLOBAL (race condition here...)
<snip>
gyp: binding.gyp not found (cwd: <snip>) while trying to load binding.gyp
gyp ERR! configure error <-- YES because it doesn't exist, I want to use 'custom.gyp'
gyp ERR! stack Error: `gyp` failed with exit code: 1
<snip>
仅代表我删除无关信息。
也许我可以通过修改Python包装器本身来解决它,但还有其他方法吗?例如一些<snip>
?
答案 0 :(得分:3)
在node-gyp repo看起来现在有相当多的文档。
答案 1 :(得分:1)
Node-gyp没有很好的文档记录,所以下面的陈述是我从项目来源的发现。
node-gyp的选项取决于命令。这些选项列在configDefs
对象中。其中一些被翻译成GYP选项,其他则没有。
GYP文件名binding.gyp
在configure.js
可能在node-gyp调用之前在GYP_*
环境变量中设置GYP选项。请参考GYP命令行帮助和sources,因为GYP也没有很好地记录。