所以我有一个项目,我一直在使用node-gyp
将C ++移植到node.js.一切都在运作,但是当我以前运行node-gyp build
时,我会在执行int
之前做一些警告,例如使用unsigned long int
。node test.js
。所以我做了一些清理工作并摆脱了所有错误,但现在当我运行MAC:project home$ node test.js
module.js:340
throw err;
^
Error: Cannot find module 'build/Release/graph'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/home/sutff/project/test.js:1:75)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
时,我得到了
node-gyp configure
当我node-gyp build
和MAC:project home$ node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@0.12.1
gyp info using node@0.10.21 | darwin | x64
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',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/home//sutff/project/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/home/.node-gyp/0.10.21/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/home/.node-gyp/0.10.21',
gyp info spawn args '-Dmodule_root_dir=/Users/home//sutff/project',
gyp info spawn args '--depth=.',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info ok
MAC:project home$ node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@0.12.1
gyp info using node@0.10.21 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/graph/graph/addon.o
CXX(target) Release/obj.target/graph/graph/directed_graph.o
CXX(target) Release/obj.target/graph/graph/binding.o
SOLINK_MODULE(target) Release/graph.node
SOLINK_MODULE(target) Release/graph.node: Finished
gyp info ok
时,我得到了
test.js
并且所有var Graph = require('build/Release/graph');
文件都包含此
{{1}}
我不明白如何修复错误,可能会改变构建文件的位置或者为什么它会完美编译然后返回此消息。我做错了什么?