The README contained in the module is a good step for new users, but a project documentation page would be great.

Would you mind adding a page?

Comments

adammalone’s picture

There are a few specific things that aren't detailed in the README that could be added to either that or a doco page. I'd be willing to do a quick write up that echoed the way I got nodejs working.

bhosmer’s picture

Me too. I found some outdated information and would like a place for us to contribute our docs other than just the issue que.

spax’s picture

Perhaps you all would be so nice as to add your documentation here in the meantime to help people like me who need help now. =)

broncomania’s picture

Specially the mistakes which already collected here should be mentioned for an easy installation. This will defenitly help new people to get an ahhhhhhh feeling. Its a liitle bit tricky to set it up.

Anonymous’s picture

Status: Active » Fixed

done, i've added a page in on d.o. and added a link to it on the node.js project page.

https://drupal.org/node/1713530

it's just a cut and paste of readme.txt, but it is now a place we can work.

edits welcome!

bhosmer’s picture

Thanks man!

spax’s picture

And I'm a complete noob who's never built from source on Ubuntu, so I would appreciate extreme detail if possible!

bhosmer’s picture

If I remember correctly, when I installed it on Ubuntu it wasn't that hard. There was a versioning problem that I had with socket.io though and I had to manually specify a version other than the latest. When I get a chance, I will go through an install again and see if anything has changed.

bhosmer’s picture

This was from May of 2012 when I tried my install:

I needed to specify the versions of express and connect. I believe node and npm are in apt so you shouldn't need to build them from source at all. Use apt-get install node npm

npm install socket.io
npm install request
npm --node-version=0.4.12 install express@2.4.3
npm --node-version=0.4.12 install connect@1.1.4

I'm adding it here for @spax, and after I verify if it is still needed, I will update the documentation page as well.

spineless’s picture

The instructions to install nodejs I feel are ok but i am having issues with the last two items. Installing npm and running server.js

When I attempted to use the instructions provided by bhosmer I noticed that my system did not have socket.io or the request modules. I was able to follow the commands outlined and install express and connect as well.

But when I attempted to start the server using the command node server.js I did not get very far.

The system stops at:

Started http server.
info - socket.io started

I am thinking there is something wrong with my config file. I tried using the example config as well as creating the file using the module config builder tool but this error is persistent. Can you please provide your config file as an example?

Thanks,

spineless

adammalone’s picture

This is the useable (ie not commented) part of my config file
Note, I have changed my service key for security:

settings = {
  scheme: 'http',
  port: 8881,
  host: '103.1.186.193',
  resource: '/socket.io',
  serviceKey: 'ogre900IFEO903rh3psM51HF',
  backend: {
    port: 80,
    host: 'nodejs.adammalone.net',
    scheme: 'http',
    basePath: '',
    messagePath: '/nodejs/message'
  },
  debug: true,
  sslKeyPath: '',
  sslCertPath: '',
  sslCAPath: '',
  baseAuthPath: '/nodejs/',
  publishUrl: 'publish',
  kickUserUrl: 'user/kick/:uid',
  logoutUserUrl: 'user/logout/:authtoken',
  addUserToChannelUrl: 'user/channel/add/:channel/:uid',
  removeUserFromChannelUrl: 'user/channel/remove/:channel/:uid',
  addChannelUrl: 'channel/add/:channel',
  removeChannelUrl: 'channel/remove/:channel',
  setUserPresenceListUrl: 'user/presence-list/:uid/:uidList',
  addAuthTokenToChannelUrl: 'authtoken/channel/add/:channel/:uid',
  removeAuthTokenFromChannelUrl: 'authtoken/channel/remove/:channel/:uid',
  toggleDebugUrl: 'debug/toggle',
  contentTokenUrl: 'content/token',
  publishMessageToContentChannelUrl: 'content/token/message',
  extensions: [],
  clientsCanWriteToChannels: false,
  clientsCanWriteToClients: false,
  transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling'],
  jsMinification: true,
  jsEtag: true,
  logLevel: 1
};

There's nothing wrong with stopping where your did after you started it. My only recommendation would be for you to set debug: true as I have done and then navigate around the site (perhaps try to send a broadcast to all message from the nodejs notifications module). Watch your terminal for nodejs debug messages and your watchdog log. If you're getting errors somewhere ping them back here!

spineless’s picture

Thanks for your help. Telling me to test by broadcasting a message was very helpful. I was able to see a message in my ssh terminal.

So I guess nodejs must be working.

One thing I noticed about the setup that should be mentioned in the document is that the install should be the administrator. SUDO authorization is required.

adammalone’s picture

Correct. node and forever (another package installed via npm to make a node server into a service [starts it again automatically if it crashes etc]) are best installed with the global flag npm install -g node which does, as you say ,require root.

spax’s picture

Thanks bhosmer, I'll let you know once I get around to trying an install.

bhosmer’s picture

@spax since I'm not really much of a javascript guy, I found the nodejs irc channel fairly helpful with most node specific stuff. That is where I learned about specifying a particular version with npm.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.