Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
now.js file => replace fileServer with "fs"?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
christianstrang  
View profile  
 More options Dec 30 2011, 10:52 am
From: christianstrang <g...@christianstrang.de>
Date: Fri, 30 Dec 2011 07:52:28 -0800 (PST)
Local: Fri, Dec 30 2011 10:52 am
Subject: now.js file => replace fileServer with "fs"?
If I run the "quick example" from here: http://nowjs.com/doc/example I
receive the error "cannot find module .fileServer" which is linked in
the now.js file.
Do I have to replace "fileServer" with "fs" or did I install node.js
wrong? Is fileServer a module which is installed together with Now?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Zhang  
View profile  
 More options Dec 30 2011, 1:05 pm
From: Eric Zhang <e...@nowjs.com>
Date: Fri, 30 Dec 2011 10:05:53 -0800
Local: Fri, Dec 30 2011 1:05 pm
Subject: Re: [NowJS] now.js file => replace fileServer with "fs"?

Hi christian,

fileServer is part of the NowJS library package. How did you install NowJS?
If you used npm, and ran the command `npm install now` then fileServer
should've automatically been included.

Eric

On Fri, Dec 30, 2011 at 7:52 AM, christianstrang <g...@christianstrang.de>wrote:

> If I run the "quick example" from here: http://nowjs.com/doc/example I
> receive the error "cannot find module .fileServer" which is linked in
> the now.js file.
> Do I have to replace "fileServer" with "fs" or did I install node.js
> wrong? Is fileServer a module which is installed together with Now?

--
Co-Founder @ Flotype, makers of NowJS

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
christianstrang  
View profile  
 More options Dec 30 2011, 1:47 pm
From: christianstrang <g...@christianstrang.de>
Date: Fri, 30 Dec 2011 10:47:00 -0800 (PST)
Subject: Re: now.js file => replace fileServer with "fs"?
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

On Dec 30, 7:05 pm, Eric Zhang <e...@nowjs.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Zhang  
View profile  
 More options Dec 31 2011, 2:36 am
From: Eric Zhang <e...@nowjs.com>
Date: Fri, 30 Dec 2011 23:36:02 -0800
Local: Sat, Dec 31 2011 2:36 am
Subject: Re: [NowJS] Re: now.js file => replace fileServer with "fs"?

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:

--
Co-Founder @ Flotype, makers of NowJS

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
christianstrang  
View profile  
 More options Dec 31 2011, 5:45 am
From: christianstrang <g...@christianstrang.de>
Date: Sat, 31 Dec 2011 02:45:48 -0800 (PST)
Local: Sat, Dec 31 2011 5:45 am
Subject: Re: now.js file => replace fileServer with "fs"?
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Zhang  
View profile  
 More options Dec 31 2011, 5:51 am
From: Eric Zhang <e...@nowjs.com>
Date: Sat, 31 Dec 2011 02:51:05 -0800
Local: Sat, Dec 31 2011 5:51 am
Subject: Re: [NowJS] Re: now.js file => replace fileServer with "fs"?

Hi Christian,

Once you npm install now, you no longer need to require the relative path
to the now folder, but rather the keyword now.

So your code should look like `var nowjs = require('now');`

Note that you must run your node server from the same folder that you ran
`npm install now`

Eric

On Sat, Dec 31, 2011 at 2:45 AM, christianstrang <g...@christianstrang.de>wrote:

--
Co-Founder @ Flotype, makers of NowJS

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »