I am trying to make a Node extension per...
http://nodejs.org/api/addons.html#addons_hello_world
With a couple minor modifications (mine is called helloworld.cc and testnode.js) but when I try to compile the following line...
require('./build/Release/helloworld');
I get the following ST
node.js:242
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: invalid argument
at Object..node (module.js:475:11)
at Module.load (module.js:351:32)
at Function._load (module.js:309:12)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/home/jackie/Desktop/hellonode/testnode.js:1:63)
at Module._compile (module.js:444:26)
at Object..js (module.js:462:10)
at Module.load (module.js:351:32)
at Function._load (module.js:309:12)
an ls of the release directory is ...
total 124 -rw-rw-r-- 1 jackie jackie 70288 2012-04-07 16:16 helloworld_1.o -rwxrwxr-x 1 jackie jackie 49431 2012-04-07 16:16 helloworld.node
Thanks
Jackie
The name of the .node
file needs to match the name in the NODE_MODULE
macro.
NODE_MODULE(hello, init);
needs to be changed to
NODE_MODULE(helloworld, init);