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
[email protected] /usr/local/lib/node_modules/node-gyp
[email protected]
Но где на самом деле задокументированы [options]
? Я просмотрел различные исходные файлы .js, чтобы попытаться понять это, и ничего не нашел.
Делает ли [options]
только сквозной доступ к gyp?
В частности, я пытаюсь использовать файл привязок, который не называется «binding.gyp», но похоже, что оболочка node -> Python, которая находится между node.js и gyp, не позволяет это из-за некоторого жесткого кодирования ( насколько я могу понять).
Например: 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>
где <snip>
означает, что я удаляю ненужную информацию.
Может быть, я могу обойти это, изменив саму оболочку Python, но есть ли другой способ? Какой-нибудь node-gyp --option=x
например?