按照官方wiki的做法 https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules
首先确保安装python,gcc,make 全局安装nw-gyp 运行nw-gyp rebuild --target=0.6.2
但是结果是
gyp info it worked if it ends with ok
gyp info using nw-gyp[@0](/user/0).7.3-4
gyp info using node[@0](/user/0).10.5 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/Users/xlaok/.nw-gyp/0.6.2/tools/gyp/gyp',
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/xlaok/joymap/svgTools/node_modules/svg2png/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/nw-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/xlaok/.nw-gyp/0.6.2/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/xlaok/.nw-gyp/0.6.2',
gyp info spawn args '-Dmodule_root_dir=/Users/xlaok/joymap/svgTools/node_modules/svg2png',
gyp info spawn args '--depth=.',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: /Users/xlaok/joymap/svgTools/node_modules/svg2png) while trying to load binding.gyp
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/nw-gyp/lib/configure.js:406:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Darwin 12.2.1
gyp ERR! command "node" "/usr/local/bin/nw-gyp" "rebuild" "--target=0.6.2"
gyp ERR! cwd /Users/xlaok/joymap/svgTools/node_modules/svg2png
gyp ERR! node -v v0.10.5
gyp ERR! nw-gyp -v v0.7.3-4
gyp ERR! not ok
谁能帮我看一下呢?急…