Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto:3638 return (new Hash).init(hash); TypeError: undefined is not a function #1

Open
royiby opened this issue Jun 3, 2010 · 6 comments

Comments

@royiby
Copy link

royiby commented Jun 3, 2010

crypto:3638
return (new Hash).init(hash);
^
TypeError: undefined is not a function
at CALL_NON_FUNCTION_AS_CONSTRUCTOR (native)
at Object.createHash (crypto:3638:11)
at hash (/var/www/drupal/sites/all/taxi/miksago-pusher-api-4812f17/lib/sPusher.js:45:17)
at buildQueryString (/var/www/drupal/sites/all/taxi/miksago-pusher-api-4812f17/lib/sPusher.js:40:20)
at buildRequestPath (/var/www/drupal/sites/all/taxi/miksago-pusher-api-4812f17/lib/sPusher.js:29:21)
at buildRequest (/var/www/drupal/sites/all/taxi/miksago-pusher-api-4812f17/lib/sPusher.js:16:21)
at Object.trigger (/var/www/drupal/sites/all/taxi/miksago-pusher-api-4812f17/lib/sPusher.js:9:17)
at Object. (/var/www/drupal/sites/all/taxi/miksago-pusher-api-4812f17/example/client.js:17:8)
at Module._compile (module:384:23)
at Module._loadScriptSync (module:393:16)

@royiby
Copy link
Author

royiby commented Jun 3, 2010

i just need to add that i renamed index.js-> sPusher.js and used the README example
with the 5 arguments like so:

Pusher.trigger(config, "test_channel", "new-event", "{"description":"WebPusher","title":"what?"}",
function(request)
{
request.addListener("connect", function(){request.addListener("data", function(d){sys.puts(sys.inspect(p));})});
request.addListener("ok", function(){sys.puts("Submitted message okay.");})
.addListener("error", function(code){sys.puts("Error: received code "+code);});
});

@redsquirrel
Copy link
Owner

What version of node are you using?

@royiby
Copy link
Author

royiby commented Jun 3, 2010

my node version of node is v.0.1.97 as the print out below indicates.

royi@brenda:~$ node -v
v0.1.97

thank you for the fast reply
royi

@redsquirrel
Copy link
Owner

I downloaded 0.1.97 and ran your example and it worked for me, although, I didn't rename the file. Did you change the require in your example to point to your sPusher file?

@royiby
Copy link
Author

royiby commented Jun 3, 2010

yes, i did, before that it cried it can't find the module...weird

@royiby
Copy link
Author

royiby commented Jun 14, 2010

o.k. - i have a solution for this issue :^)

it's a problem with libssl -dev (it wasn't there though openssl was installed), so (in linux) you need to install it by:

apt-get install libssl-dev

then reinstall node.js (don't forget you need sudo make install or there will be an error).

hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants