0

I'm trying to test out a node/backbone tutorial at this git hub site $ git clone git://github.com/antoviaque/backbone-relational-tutorial.git. When I start the node server (by running command node app), I'm getting an error that a method create doesn't exist in a restify module. The error's triggered right after the server appears to start

restify listening at http://0.0.0.0:3001

I'm not at all experienced with node, and would appreciate any help you can offer.

node_modules/restify/lib/server.js:724
        d = domain.create();

Object function Domain(options){
...lots of code ommitted....
    has no method 'create'
        at Server._run (/Users/mm/Sites/backboneforum/node_modules/restify/lib/server.js:724:20)
        at onRoute (/Users/mm/Sites/backboneforum/node_modules/restify/lib/server.js:592:38)
        at Router.find (/Users/mm/Sites/backboneforum/node_modules/restify/lib/router.js:372:17)
        at _route (/Users/mm/Sites/backboneforum/node_modules/restify/lib/server.js:532:29)
        at Server._handle (/Users/mm/Sites/backboneforum/node_modules/restify/lib/server.js:617:17)
        at Server.onRequest (/Users/mm/Sites/backboneforum/node_modules/restify/lib/server.js:201:22)
        at Server.emit (events.js:70:17)
        at HTTPParser.onIncoming (http.js:1514:12)
        at HTTPParser.onHeadersComplete (http.js:102:31)
        at Socket.ondata (http.js:1410:22)
loganfsmyth
  • 156,129
  • 30
  • 331
  • 251
BrainLikeADullPencil
  • 11,313
  • 24
  • 78
  • 134
  • 1
    Which version of Node.js are you running? Domains have been introduced in 0.8.x, so perhaps you have an older version installed? You can find out using `$ node --version` at the command prompt. – Golo Roden Mar 12 '13 at 06:15
  • That seesm to have been a problem. I was using 0.6, but then I upgraded to latest .10 and got Module version mismatch. Expected 11, got 1 – BrainLikeADullPencil Mar 12 '13 at 06:29
  • Actually the package json file in the app says "node":">= 0.6.0 < 0.7.0". It's not expecting me to use 0.8x – BrainLikeADullPencil Mar 12 '13 at 06:30
  • Try adjusting this setting in package.json to a value that also accepts 0.8.x. Quite often this works as well. – Golo Roden Mar 12 '13 at 07:42
  • I've put the comments into an answer. If this answers your question, it would be great if you could a) mark it as answer, and b) up-vote it. Thanks :) – Golo Roden Mar 12 '13 at 07:45

1 Answers1

1

To put the comments into an answer:

It does not work, because the domain module was introduced as part of Node.js 0.8. As you are running 0.6, it can not be found. Hence you get an appropriate error message.

As you have said, your package.json says:

"node": ">= 0.6.0 < 0.7.0"

Try adjusting this setting to a value that also accepts Node.js 0.8 (or even 0.10), or - which may be the better solution - get rid of this line completely. If you do not use any things specific to Node.js 0.6, everything should still work.

Hope this helps.

Golo Roden
  • 140,679
  • 96
  • 298
  • 425