It works on 0.8.x and 0.10.x (I tested both). The point is that the “finish” event isn’t emitted in 0.10 any more. Instead we supply the handler in the call to the “end” function, which works on both 0.8 and 0.10.

From: sbellone <notifications@github.com<mailto:notifications@github.com>>
Reply-To: VirtuOz/node-dynamic-module-loader <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Monday, December 23, 2013 at 9:09 AM
To: VirtuOz/node-dynamic-module-loader <node-dynamic-module-loader@noreply.github.com<mailto:node-dynamic-module-loader@noreply.github.com>>
Subject: Re: [node-dynamic-module-loader] Do not write multiple error packages (#8)


In lib/dynamic_module_loader.js:

>
>                  res.on('data', function (chunk) {
>                      downloadFile.write(chunk);
>                  });
>
>                  res.on('end', function() {
> -                    downloadFile.end();
> +                    // We don't listen to the 'finish' event because that was changed somewhere between 0.8.x and
> +                    // 0.10.x. It used to be called 'close' but the goats at Joyent decided to introduce an incompatible


Hmm, so the tests won't pass on a 0.8.x installation right?
FYI, we are for the moment forced to stay with a 0.8.x version on the servers because at some point it crashes with a 0.10.x version. (I lost time on that when we reinstalled the new dev platform before Oliv told me to install a 0.8.x version)
So we should be consistent. If the tests are done to run with a 0.10.x, we need to take time to investigate and fix the whole kQueryServer to make it running with a 0.10.x version.

They are not goats, they just do OSS :/

—
Reply to this email directly or view it on GitHub<https://github.com/VirtuOz/node-dynamic-module-loader/pull/8/files#r8530348>.