Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.Js + Now.js on windows: cannot load module node-proxy

I am trying to create a chatclient for mobile devices using node.js and now.js. The problem is that the server must run on a windowsserver. Getting node.js working is not the problem.

The problem is now.js. I have already installed node.js and the modules: now.js and it's dependencies socket.io, socket.io-client. But socket.io still needs the module node-proxy. And that wont work on windows because it has to be build after installing.

Does anyone know how to get the module node-proxy for node.js working on windows? I have read something about building with cygwin but i dont have experience ( or knowledge) about cygwin.

like image 255
Domenique van der Niet Avatar asked Mar 31 '26 07:03

Domenique van der Niet


1 Answers

I'm coping the contents of the link nevf included in the comments to the question. I'm always scared links will go dead at some point. Thanks to user george from source link for providing this solution that got me up and running.

I just wrote a tutorial about getting it running under windows 7: http://nodegames.blogspot.com/2011/12/install-nowjs-in-windows.html Summation:

Install nowjs in Windows

First you have to go through the process of installing node.js in windows. I have detailed the process here: http://nodegames.blogspot.com/2011/12/install-nodejs-in-windows.html

There's two requirements for nowjs to run on windows:

Microsoft Visual C++ Runtime:

Go ahead and install it if you don't already have it.

http://www.microsoft.com/download/en/details.aspx?id=5555

socket.io:

So we can open a CMD window and type:

C:\progra~1\nodejs\npm install socket.io

If your node.js install is in a different directory then change the path accordingly.

NPM will install it to:

C:\Program Files\nodejs\node_modules\socket.io

Good. Now we need to obtain the nowjs windows build here:

https://github.com/Flotype/now/zipball/windows

The file will read something like Flotype-now-0.7.6-3-gb41b2b2.zip

Unzip it to a folder. Inside that folder you'll have another folder with a similar name.

So: ~\Downloads\Flotype-now-0.7.6-3-gb41b2b2\Flotype-now-b41b2b2

Let's rename the second folder to now

So: ~Downloads\Flotype-now-0.7.6-3-gb41b2b2\now

Copy out the now folder and paste it to:

C:\Program Files\nodejs\node_modules\

So: C:\Program Files\nodejs\node_modules\now

Inside of that now folder there should be subfolders like bin, doc, examples and other items.

You now have nowjs installed within windows as a module for node.js. It looks like quite a bit of steps, but in reality it is quite painless and if you followed the steps you've seen that.

Time to test it!

The nowjs people have supplied us with three example projects:

They are located in: C:\Program Files\nodejs\node_modules\now\examples express_example helloworld_example multiroomchat_example

Let's jump to the fun stuff and try and get multiroomchat_example going.

Firstly close down any node.js server CMD window instances you have running.

Open up a new CMD window and type:

C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules \now\examples\multiroomchat_example\multiroomchat_server.js

Hit enter.

You now have node.js running the multiroom chat example server.

Take a look by pointing a few browsers to http://localhost:8080/ it will prompt you for a name.

And if everything went perfectly you have now installed and tested nowjs.

A multi-room chat example in under 10 minutes, less than that if you're quick! From this point we have the ability to communicate in real-time to multiple browsers and a server, the basis for a MMORPG.

like image 110
Kuberchaun Avatar answered Apr 02 '26 20:04

Kuberchaun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!