This is my code in the server.js file (which lies in /var/www/virtual/
domain.com/htdocs/helloworld):
var html = require('fs').readFileSync(__dirname+'/index.html');
var server = require('http').createServer(function(req, res){
res.end(html);
});
server.listen(8080);
var nowjs = require("../now"); //the now.js file is one folder up
var everyone = nowjs.initialize(server);
everyone.now.distributeMessage = function(message){
everyone.now.receiveMessage(
this.now.name, message);
};
If I call "node server.js" I receive the following output:
node.js:201
throw e; // process.nextTick error, or 'error' event on first
tick
^
Error: Cannot find module './fileServer'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object.<anonymous> (/var/www/virtual/
domain.com/htdocs/now.js:
2:18)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
On Dec 31, 8:36 am, Eric Zhang <
e...@nowjs.com> wrote:
> Hmm that looks correct. Can you send me the output the code of your program?
>
> Eric
>
> On Fri, Dec 30, 2011 at 10:47 AM, christianstrang <
g...@christianstrang.de>wrote:
>
>
>
>
>
>
>
>
>
> > Mh.. here is how I installed it and what I got:
>
> > root@vmanager433:/var/www/virtual/
domain.com/htdocs# npm install now
> > npm WARN node-pr...@0.5.2 package.json: bugs['web'] should probably be
> > bugs['url']
>
> > > node-pr...@0.5.2 install /var/www/virtual/
> >
domain.com/htdocs/node_modules/now/node_modules/node-proxy
> > > make
>
> > BUILDING: C++ Component
> > Checking for program g++ or c++ : /usr/bin/g++
> > Checking for program cpp : /usr/bin/cpp
> > Checking for program ar : /usr/bin/ar
> > Checking for program ranlib : /usr/bin/ranlib
> > Checking for g++ : ok
> > Checking for node path : not found
> > Checking for node prefix : ok /usr/local
> > 'configure' finished successfully (0.027s)
> > Waf: Entering directory `/var/www/virtual/
domain.com/htdocs/
> > node_modules/now/node_modules/node-proxy/src/build'
> > [1/2] cxx: node-proxy.cc -> build/Release/node-proxy_1.o
> > [2/2] cxx_link: build/Release/node-proxy_1.o -> build/Release/node-
> > proxy.node
> > Waf: Leaving directory `/var/www/virtual/
domain.com/htdocs/
> > node_modules/now/node_modules/node-proxy/src/build'
> > 'build' finished successfully (0.671s)
> > n...@0.7.6 ./node_modules/now
> > âââ node-pr...@0.5.2