Question

I am compiling my first hello world node-gyp program from Addons Node.js v0.10.21 doc. Typing "node-gyp configure" causes an error as shown below. Appreciate any help in fixing this error.

node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@0.10.10
.......
.......
Traceback (most recent call last):
  File "/usr/local/lib/node_modules/node-gyp/gyp/gyp", line 18, in <module>
    sys.exit(gyp.main(sys.argv[1:]))
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 526, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 502, in gyp_main
    options.circular_check)
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 131, in Load
    params['parallel'])
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2574, in Load
    targets = BuildTargetsDict(data)
  File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 1273, in BuildTargetsDict
    target['target_name'],
KeyError: 'target_name'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:424:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.8.0-31-generic
gyp ERR! command "node" "/usr/local/bin/node-gyp" "configure"
gyp ERR! cwd /home/jq/test/node/hw-gyp
gyp ERR! node -v v0.10.20
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
Was it helpful?

Solution

KeyError: 'target_name'

Sounds like you failed to specify the target_name property in your binding.gyp file. Can you post the contents of the binding.gyp in your question?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top