rappid/rAppid.js

tried node's require("domain") and it failed with error: TypeError: Object #<Object> has no method 'apply'

Closed this issue · 3 comments

sudo npm install -g rAppid.js
rappidjs create app testApp ./testApp
cd testApp
rappidjs server . 

leads to the following error

serverRoot: /home/merle/workbench/testApp/server
DocumentRoot: /home/merle/workbench/testApp/public
Config: /home/merle/workbench/testApp/server/config.json
WARN: No index.js for server module defined. Please add a index.js file in the project directory
{ [Error: Tried loading "domain" at /home/merle/workbench/testApp/server/domain.js then tried node's require("domain") and it failed with error: TypeError: Cannot call method 'apply' of null]
  originalError: [TypeError: Cannot call method 'apply' of null],
  moduleName: 'domain',
  requireModules: [ 'domain' ] }
{ [Error: Tried loading "domain" at /home/merle/workbench/testApp/server/domain.js then tried node's require("domain") and it failed with error: TypeError: Cannot call method 'apply' of null]
  originalError: [TypeError: Cannot call method 'apply' of null],
  moduleName: 'domain',
  requireModules: [ 'domain' ] } 

which node version are you using?

v.0.6.12

That's the problem. Domains are supported since version 0.8. see here http://blog.nodejs.org/2012/06/25/node-v0-8-0/ So updating node will help.

Another option is to install the http-server node module
npm install http-server
and then just call http-server inside the public dir.

Or let apache serve the files inside the public dir.