node-jsonrpc icon indicating copy to clipboard operation
node-jsonrpc copied to clipboard

throw e

Open vinnitu opened this issue 15 years ago • 3 comments

what is version node you use? I have

$ node -v v0.3.0-pre

and get next result to run test

$ node test.js

node.js:50 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: process.mixin() has been removed. at EventEmitter.mixin (node.js:13:11) at Object. (/home/victor/temp/javascript/node-jsonrpc/test/test.js:69:9) at Module._compile (node.js:316:23) at Object..js (node.js:324:12) at Module.load (node.js:250:25) at Object.runMain (node.js:338:24) at Array. (node.js:588:12) at EventEmitter._tickCallback (node.js:42:22) at node.js:604:9

vinnitu avatar Oct 12 '10 20:10 vinnitu

Whatever the latest version was in November of 2009, which unfortunately I don't know.

I would happily accept patches that brought this back into compatibility with the current version of node.js.

ericflo avatar Oct 12 '10 20:10 ericflo

with mixin helps next code:

function import(to, from) { for (var key in from) { if (from.hasOwnProperty(key)) { to[key] = from[key]; } } }

//process.mixin(exports, JSONRPC); import(exports, JSONRPC); and server starts (and maybe work properly)

But client.js get new error:

$ node client.js

node.js:63 throw e; ^ Error: Promise has been removed. See http://groups.google.com/group/nodejs/msg/0 c483b891c56fea2 for more information. at new removed (events:117:9) at [object Object].call (/var/home/sklyar/node.js/node-jsonrpc/src/jsonrpc.j s:29:23) at Object. (/var/home/sklyar/node.js/node-jsonrpc/examples/client .js:6:8) at Module._compile (node.js:462:23) at Module._loadScriptSync (node.js:469:10) at Module.loadSync (node.js:338:12) at Object.runMain (node.js:522:24) at Array. (node.js:756:12) at EventEmitter._tickCallback (node.js:55:22) at node.js:768:9

I cannot dot it because have not enough experience yet :( But maybe information can help you to make update. It seems that "promises" was fully excluded from node.js http://groups.google.com/group/nodejs/msg/0 c483b891c56fea2

vinnitu avatar Oct 13 '10 13:10 vinnitu

Hi all,

a quick patch, replace:

process.mixin(exports, JSONRPC);

with:

function import(to, from) {
    for (var key in from) {
        if (from.hasOwnProperty(key)) {
            to[key] = from[key];
        }
    }
}

import(exports, JSONRPC);

Hope this helps

Reggino avatar Nov 07 '10 11:11 Reggino