Reputation: 5762
I have node-gyp installed on my iMAC:
macOS Big Sur
Version 11.2.3
When I try to build a module:
node-gyp configure build
I get:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 3.9.2 found at "/usr/local/opt/[email protected]/bin/python3.9"
gyp info spawn /usr/local/opt/[email protected]/bin/python3.9
gyp info spawn args [
gyp info spawn args '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/sy/Fathom3/a-safe-backend-server-master/test-addon/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/sy/Library/Caches/node-gyp/15.11.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/sy/Library/Caches/node-gyp/15.11.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/sy/Library/Caches/node-gyp/15.11.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/sy/Fathom3/a-safe-backend-server-master/test-addon',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: *** No rule to make target `Release/obj.target/hello/hello.o', needed by `Release/hello.node'. Stop.
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:378:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "configure" "build"
gyp ERR! cwd /Users/sy/Fathom3/a-safe-backend-server-master/test-addon
gyp ERR! node -v v15.11.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
Here is the content of building.gyp:
{
"targets":[
{
"target_name": "hello",
"sources": ["hello.cc"]
}
]
}
Can anyone help?
Upvotes: 0
Views: 952
Reputation: 5762
Fixed, the building.gyp should have read:
{
"targets":[
{
"target_name": "hello",
"sources": ["cppsrc/hello.cc"]
}
]
}
The path of where the source is required.
Upvotes: 1