1

I am newbie and I am writing a simple program based Node.js. everything is fine until I added this line:

process.addListener('SIGINT', function(){ console.log( 'Sigint test.' ); } );

Run: Node sample.js

I got following message:

node.js:203
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: No such module
    at EventEmitter.<anonymous> (node.js:361:27)
    at Object.<anonymous> (D:\Nodejs\MySample\sample.js:13:9)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Array.<anonymous> (module.js:470:10)
    at EventEmitter._tickCallback (node.js:195:26)

Environment:

Windows XP sp2 Node.js 0.5.9 for Windows

help me please...

Imanok
  • 11
  • 2
  • To me it looks like they don't use addListener function any more. Instead they use the 'on' function: http://nodejs.org/docs/v0.5.9/api/process.html#signal_Events – Clint Oct 25 '11 at 14:32
  • thanks for your reply, I use process.on to replace process.addListener, but it still does not work, I got error message same as before. – Imanok Oct 25 '11 at 15:13
  • I have found the answer: SIGINT is not supported in windows indeed. It is possible to capture ctrl+c / ctrl+break on windows, but there is no support for this yet in node. – Imanok Oct 26 '11 at 12:56
  • 1
    https://github.com/joyent/node/issues/1553 – Imanok Oct 26 '11 at 12:56
  • Oh man. I wish I would have thought of that :-) Thanks for the heads up. – Clint Oct 26 '11 at 20:10

0 Answers0