Hello,

I try to use nodejs but looks like a configuration/ installation problem...

OS: centos 5.7
nodejs: v0.6.11 (YUM REPO http://nodejs.tchol.org/stable installed as rpm)

I installed express and socket.io with npm installer inside drupal nodejs module directory (here located server.js and configuration file) and tried to start it with "nodejs server.js" (nodejs.config.js generated by Drupal nodejs module).

Starting http server.

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'get'
at Object. (/path-to-drupal-site/modules/nodejs/server.js:626:4)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)

nodejs is installed at another server for testing first . If it works fine I'll install it at the drupal server. But I think it should start anyway...

Any hints?

Comments

julien’s picture

You can try downgrading you node version from v0.6.11 to lower like v0.4.9? There is other source here

JohnnyX’s picture

Hello julien,

iInstalled v0.4.9 inside a sub directory, but same error...

./configure
make
sudo make install
Starting http server.

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
TypeError: Object #<Router> has no method 'get'
    at Object.<anonymous> (/path-to-drupal-sitel/modules/nodejs/node-v0.4.9/server.js:626:4)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at Array.<anonymous> (module.js:421:10)
    at EventEmitter._tickCallback (node.js:126:26)

I tested a simple "hello world" with the first nodejs version from yum repo and it works so far...

// Load the http module to create an http server.
var http = require('http');

// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.end("Hello World\n");
});

// Listen on port 8000, IP defaults to 127.0.0.1
server.listen(8000);

// Put a friendly message on the terminal
console.log("Server running at http://127.0.0.1:8000/");

nodejs starts without error and show me "Hello World" at 127.0.0.1:8000...
So I think nodejs should work fine, but config for Drupal (generated by heartbeat module) doesn't work?

julien’s picture

Are you using this connect version and express version?
npm install connect@1.1.4
npm install express@2.4.3

JohnnyX’s picture

Explicit installed and tested again. Same problem...
Why the 0.6 version via repo doesn't work?

Looks like da good way (via yum repo). No one have the same error?