Node on Windows with Cygwin: Necessary Files

135 views
Skip to first unread message

Simon

unread,
Jun 27, 2010, 6:02:26 PM6/27/10
to nodejs
I now have Node successfully running on Win32 (Server 2003 in my case)
using Cygwin. The compile process was fairly straightforward and went
smoothly.

The problem is C:\cygwin takes up about a Gig of space just to support
a 13MB Node installation. This is a bit much and makes it difficult to
distribute Node to other Windows machines without either downloading
all those files or starting the process from scratch on each machine.

I was able to get a slimmer install (110MB) of Cygwin running on
another machine and just copy over the Node files from /usr/local
(required default Cygwin setup plus OpenSSL runtime). This still seems
a bit bloated, however.

Can anyone tell me what Cygwin files / directories are necessary at
the minimum to distribute a fully functional Node runtime for Windows?

Cheers,
Simon

Chris Winberry

unread,
Jun 27, 2010, 6:16:08 PM6/27/10
to nod...@googlegroups.com

Been down this path before. Run filemon (from what used to be SysInternals) before launching node and filter on node/cygwin.


--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.

Simon

unread,
Jun 27, 2010, 7:34:42 PM6/27/10
to nodejs
Thanks Chris. I've managed to get it down to 23MB (7MB zipped)
including the Node executable. If anyone is interested in testing this
build, shoot me an email and I will supply a link.

Cheers


On Jun 28, 8:16 am, Chris Winberry <cpt.obvi...@gmail.com> wrote:
> Been down this path before. Run filemon (from what used to be SysInternals)
> before launching node and filter on node/cygwin.
>
> On Jun 27, 2010 6:02 PM, "Simon" <simon.stur...@gmail.com> wrote:
>
> I now have Node successfully running on Win32 (Server 2003 in my case)
> using Cygwin. The compile process was fairly straightforward and went
> smoothly.
>
> The problem is C:\cygwin takes up about a Gig of space just to support
> a 13MB Node installation. This is a bit much and makes it difficult to
> distribute Node to other Windows machines without either downloading
> all those files or starting the process from scratch on each machine.
>
> I was able to get a slimmer install (110MB) of Cygwin running on
> another machine and just copy over the Node files from /usr/local
> (required default Cygwin setup plus OpenSSL runtime). This still seems
> a bit bloated, however.
>
> Can anyone tell me what Cygwin files / directories are necessary at
> the minimum to distribute a fully functional Node runtime for Windows?
>
> Cheers,
> Simon
>
> --
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com <nodejs%2Bunsu...@googlegroups.com>.

Ciaran

unread,
Jun 28, 2010, 3:52:20 AM6/28/10
to nod...@googlegroups.com
You need very little, the cygwin dll and a couple of crypto libs, most
other dependencies will be found on most windows installations
already.

A working zip (like the one I posted to the mailing list last month) contains:

cygcrypto-0.9.8.dll (1.1Mb)
cyggcc_s-1.dll (45Kb)
cygssl-0.9.8.dll (265Kb)
cygwin1.dll (2.5Mb)
node.exe (6.2Mb)

Which comes in just a shade over 10Mb un-compressed , 3Meg compressed.
Hope that helps


-cj.

> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.

Simon

unread,
Jun 28, 2010, 9:26:03 AM6/28/10
to nodejs
Thanks Ciaran. I couldn't find your post from last month, but I think
that will be helpful. I am going to give it a go with just those
files. I am also gonna try to build a few extensions to get a more
comprehensive package.

Did you specify a --prefix= parameter when configuring your build for
Cygwin?


On Jun 28, 5:52 pm, Ciaran <ciar...@gmail.com> wrote:
> You need very little, the cygwin dll and a couple of crypto libs, most
> other dependencies will be found on most windows installations
> already.
>
> A working zip (like the one I posted to the mailing list last month) contains:
>
> cygcrypto-0.9.8.dll  (1.1Mb)
> cyggcc_s-1.dll (45Kb)
> cygssl-0.9.8.dll (265Kb)
> cygwin1.dll (2.5Mb)
> node.exe (6.2Mb)
>
> Which comes in just a shade over 10Mb un-compressed , 3Meg compressed.
>  Hope that helps
>
> -cj.
>

Ciaran

unread,
Jun 28, 2010, 10:49:36 AM6/28/10
to nod...@googlegroups.com
On Mon, Jun 28, 2010 at 2:26 PM, Simon <simon....@gmail.com> wrote:
> Thanks Ciaran. I couldn't find your post from last month, but I think
> that will be helpful. I am going to give it a go with just those
> files. I am also gonna try to build a few extensions to get a more
> comprehensive package.
>
> Did you specify a --prefix= parameter when configuring your build for
> Cygwin?

Nope, I just copied what I needed from the build sub-folder and the
cygwin bin folder :)
-cj.

Tom

unread,
Jun 29, 2010, 10:03:05 AM6/29/10
to nod...@googlegroups.com
I could use this package to use node on windows.

Would you be willing to publicize it?

- Tom

2010/6/28 Ciaran <cia...@gmail.com>

Ciaran

unread,
Jun 29, 2010, 10:18:47 AM6/29/10
to nod...@googlegroups.com
http://groups.google.co.uk/group/nodejs/msg/c2fe2d9998415b46?hl=en

But its an oldish version of node now, would be worth pushing up a new
one :) If I get a chance tonight I'll sort that for you
-cj

r...@tinyclouds.org

unread,
Jun 29, 2010, 12:55:47 PM6/29/10
to nod...@googlegroups.com
I would be interested in having a script which can build a
distributable package for cygwin. It could go into the tools
directory.

Tom

unread,
Jun 29, 2010, 5:26:30 PM6/29/10
to nod...@googlegroups.com
Would be interested in the latest version of node with cygwin too. :)

I would be interested in having a script which can build a
distributable package for cygwin. It could go into the tools
directory.

--

Simon

unread,
Jun 30, 2010, 1:14:36 AM6/30/10
to nodejs
http://dl.dropbox.com/u/341900/nodejs/nodejs-0.1.99-cygwin-full.zip

Keep in mind there are some files in that package that are not
necessary to run Node. But it will allow you to drop into a bash shell
which can be useful.

I will see if I can script the build process and if it works I'll post
it.



On Jun 30, 7:26 am, Tom <tommed...@gmail.com> wrote:
> Would be interested in the latest version of node with cygwin too. :)
>
> 2010/6/29 <r...@tinyclouds.org>
>
> > I would be interested in having a script which can build a
> > distributable package for cygwin. It could go into the tools
> > directory.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nodejs" group.
> > To post to this group, send email to nod...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > nodejs+un...@googlegroups.com<nodejs%2Bunsu...@googlegroups.com>
> > .

DTrejo

unread,
Jul 1, 2010, 6:42:49 PM7/1/10
to nodejs
Simon, you rock!

I made a writeup of how to install it both the easy way and the hard
way, in case anyone is interested:
http://blog.dtrejo.com/how-to-install-nodejs-on-windows

Have a great day everyone :)
-David

Tom

unread,
Jul 5, 2010, 3:15:49 PM7/5/10
to nod...@googlegroups.com
I got the default node setup running with cygwin pretty easily.

However, what about getting an addon like node-sqlite by orlandov (http://github.com/orlandov/node-sqlite)?

It requires you to compile sqlite3_bindings.cc and you need to have sqlite3 installed.

How would one get this running with cygwin?

- Tom

2010/6/28 Simon <simon....@gmail.com>
--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.

Simon

unread,
Jul 6, 2010, 4:10:25 AM7/6/10
to nodejs
Latest version compiled no problem.
http://dl.dropbox.com/u/341900/nodejs/nodejs-0.1.100-cygwin-full.zip

I used the instructions posted by raff to do this build from scratch
on a fresh machine and it works flawlessly.
http://wiki.github.com/ry/node/building-node-on-windowscygwin

@Tom .. I haven't tried Node on Win32 with any database yet, but I
will let ya know how she goes.

Cheers,
Simon


On Jun 30, 12:03 am, Tom <tommed...@gmail.com> wrote:
> I could use this package to use node on windows.
>
> Would you be willing to publicize it?
>
> - Tom
>
> 2010/6/28 Ciaran <ciar...@gmail.com>
> > nodejs%2Bunsu...@googlegroups.com<nodejs%252Buns...@googlegroups.com>
> > >.
> > >> >> For more options, visit this group athttp://
> > groups.google.com/group/nodejs?hl=en.
>
> > >> > --
> > >> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > >> > To post to this group, send email to nod...@googlegroups.com.
> > >> > To unsubscribe from this group, send email to
> > nodejs+un...@googlegroups.com<nodejs%2Bunsu...@googlegroups.com>
> > .
> > >> > For more options, visit this group athttp://
> > groups.google.com/group/nodejs?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "nodejs" group.
> > > To post to this group, send email to nod...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > nodejs+un...@googlegroups.com<nodejs%2Bunsu...@googlegroups.com>
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/nodejs?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nodejs" group.
> > To post to this group, send email to nod...@googlegroups.com.
> > To unsubscribe from this group, send email to

Bert Belder

unread,
Jul 6, 2010, 4:44:24 AM7/6/10
to nodejs
The node.cmd script that comes packaged with node-win32 binaries could
be improved:
- It does not accept relative paths (tries to resolve 'em from the
node/bin/ directory)
- It doesn't restore the working directory after quitting node
It's very easy to improve: http://gist.github.com/465171

- Bert

On 6 jul, 10:10, Simon <simon.stur...@gmail.com> wrote:
> Latest version compiled no problem.http://dl.dropbox.com/u/341900/nodejs/nodejs-0.1.100-cygwin-full.zip
>
> I used the instructions posted by raff to do this build from scratch
> on a fresh machine and it works flawlessly.http://wiki.github.com/ry/node/building-node-on-windowscygwin

Simon

unread,
Jul 6, 2010, 10:58:42 AM7/6/10
to nodejs
I updated the package with your suggested script and I also updated
the etc/resolv.conf file to fix DNS from within node scripts.

Thanks,
Simon

Stephen Perelson

unread,
Jul 19, 2010, 12:18:17 PM7/19/10
to nodejs
I compiled the latest (v0.1.101) nodejs and it needed cygz.dll (64Kb)
as well as the previously listed cygwin DLLs in order to run in
Windows.

On Jun 28, 9:52 am, Ciaran <ciar...@gmail.com> wrote:
> You need very little, the cygwin dll and a couple of crypto libs, most
> other dependencies will be found on mostwindowsinstallations
> already.
>
> A working zip (like the one I posted to the mailing list last month) contains:
>
> cygcrypto-0.9.8.dll  (1.1Mb)
> cyggcc_s-1.dll (45Kb)
> cygssl-0.9.8.dll (265Kb)
> cygwin1.dll (2.5Mb)
> node.exe (6.2Mb)
>
> Which comes in just a shade over 10Mb un-compressed , 3Meg compressed.
>  Hope that helps
>
> -cj.
>
> On Mon, Jun 28, 2010 at 12:34 AM, Simon <simon.stur...@gmail.com> wrote:
> > Thanks Chris. I've managed to get it down to 23MB (7MB zipped)
> > including the Node executable. If anyone is interested in testing this
> > build, shoot me an email and I will supply a link.
>
> > Cheers
>
> > On Jun 28, 8:16 am, Chris Winberry <cpt.obvi...@gmail.com> wrote:
> >> Been down this path before. Run filemon (from what used to be SysInternals)
> >> before launching node and filter on node/cygwin.
>
> >> On Jun 27, 2010 6:02 PM, "Simon" <simon.stur...@gmail.com> wrote:
>
> >> I now have Node successfully running on Win32 (Server 2003 in my case)
> >> using Cygwin. The compile process was fairly straightforward and went
> >> smoothly.
>
> >> The problem is C:\cygwin takes up about a Gig of space just to support
> >> a 13MB Node installation. This is a bit much and makes it difficult to
> >> distribute Node to otherWindowsmachines without either downloading

Simon

unread,
Jul 20, 2010, 2:14:38 AM7/20/10
to nodejs
Thanks Stephen. I have added the DLL you mentioned and made the
package available here:

http://dl.dropbox.com/u/341900/nodejs/nodejs-0.1.101-cygwin-full.zip
(7.5 MB - Includes Cygwin Environment)
http://dl.dropbox.com/u/341900/nodejs/nodejs-0.1.101-cygwin-slim.zip
(3.9 MB - Bare necessities to run Node)

Cheers,
Simon

Peter Hewat

unread,
Jul 20, 2010, 4:54:01 AM7/20/10
to nodejs
Thanks Simon for the windows package.

I have come across a little oddity:

I have created the basic hello world test but added a counter as such:

var http = require('http');
var i = 0;
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World ' + (i++));
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');

Every time I refresh the page the counter outputs 0, 2, 4, 6...
incrementing 2 instead of 1.

I have done this very same test under Ubuntu and it increments
correctly one by one.

There is something fishy here... Does someone have a clue as to what
is wrong with the windows version?

Otherwise, cygstdc++-6.dll doesn't seem to be necessary (at least not
for this simple test) and if you wish to create an even smaller
package, you can use UPX http://upx.sourceforge.net/ (my issue above
was tested without these 2 space saving tweaks)

++
Peter

On Jul 20, 8:14 am, Simon <simon.stur...@gmail.com> wrote:
> Thanks Stephen. I have added the DLL you mentioned and made the
> package available here:
>
> http://dl.dropbox.com/u/341900/nodejs/nodejs-0.1.101-cygwin-full.zip
> (7.5 MB - Includes Cygwin Environment)http://dl.dropbox.com/u/341900/nodejs/nodejs-0.1.101-cygwin-slim.zip

Neville Burnell

unread,
Jul 20, 2010, 5:26:49 AM7/20/10
to nodejs
If you are using a browser, it will be fetching the favicon along with
every page view


On Jul 20, 6:54 pm, Peter Hewat <peter.he...@gmail.com> wrote:
> Thanks Simon for the windows package.
>
> I have come across a little oddity:
>
> I have created the basic hello world test but added a counter as such:
>
> var http = require('http');
> var i = 0;
> http.createServer(function (req, res) {
>         res.writeHead(200, {'Content-Type': 'text/plain'});
>         res.end('Hello World ' + (i++));}).listen(8124, "127.0.0.1");
>
> console.log('Server running athttp://127.0.0.1:8124/');
>
> Every time I refresh the page the counter outputs 0, 2, 4, 6...
> incrementing 2 instead of 1.
>
> I have done this very same test under Ubuntu and it increments
> correctly one by one.
>
> There is something fishy here... Does someone have a clue as to what
> is wrong with the windows version?
>
> Otherwise, cygstdc++-6.dll doesn't seem to be necessary (at least not
> for this simple test) and if you wish to create an even smaller
> package, you can use UPXhttp://upx.sourceforge.net/(my issue above

Peter Hewat

unread,
Jul 20, 2010, 6:30:12 AM7/20/10
to nodejs
But of course, that explains it!

How about cygstdc++-6.dll, is it necessary?

++
Peter

On Jul 20, 11:26 am, Neville Burnell <neville.burn...@gmail.com>
wrote:
> If you are using a browser, it will be fetching the favicon along with
> every page view
>
> On Jul 20, 6:54 pm, Peter Hewat <peter.he...@gmail.com> wrote:
>
>
>
> > Thanks Simon for the windows package.
>
> > I have come across a little oddity:
>
> > I have created the basic hello world test but added a counter as such:
>
> > var http = require('http');
> > var i = 0;
> > http.createServer(function (req, res) {
> >         res.writeHead(200, {'Content-Type': 'text/plain'});
> >         res.end('Hello World ' + (i++));}).listen(8124, "127.0.0.1");
>
> > console.log('Server running athttp://127.0.0.1:8124/');
>
> > Every time I refresh the page the counter outputs 0, 2, 4, 6...
> > incrementing 2 instead of 1.
>
> > I have done this very same test under Ubuntu and it increments
> > correctly one by one.
>
> > There is something fishy here... Does someone have a clue as to what
> > is wrong with the windows version?
>
> > Otherwise, cygstdc++-6.dll doesn't seem to be necessary (at least not
> > for this simple test) and if you wish to create an even smaller
> > package, you can use UPXhttp://upx.sourceforge.net/(myissue above

Bert Belder

unread,
Aug 2, 2010, 6:50:02 PM8/2/10
to nodejs
Maybe it would be useful to have a script that generates a binary
distro; that would allow us to gradually improve it.

First shot here: http://github.com/piscisaureus/nodejs-cygwin-package

It creates a zip similar Simons 'full' package, but without WAF
scripts and C header files, because I couldn't figure out why they
should be included.

- Bert
> > > > > >> >> distribute Node to otherWindowsmachines without either downloading

Bert Belder

unread,
Aug 2, 2010, 6:51:56 PM8/2/10
to nodejs
BTW, It's meant to be checked out somewhere within the nodejs
directory, e.g. in tools/

r...@tinyclouds.org

unread,
Aug 2, 2010, 7:02:45 PM8/2/10
to nod...@googlegroups.com
On Mon, Aug 2, 2010 at 3:50 PM, Bert Belder <bertb...@gmail.com> wrote:
> Maybe it would be useful to have a script that generates a binary
> distro; that would allow us to gradually improve it.
>
> First shot here: http://github.com/piscisaureus/nodejs-cygwin-package
>
> It creates a zip similar Simons 'full' package, but without WAF
> scripts and C header files, because I couldn't figure out why they
> should be included.

I wouldn't mind including such a package in the node source tree. It
seems it should include WAF - as that's how you build addons.

r...@tinyclouds.org

unread,
Aug 2, 2010, 7:03:42 PM8/2/10
to nod...@googlegroups.com
> I wouldn't mind including such a package in the node source tree.

With the understanding that I will not be maintaining it. Perhaps it's
better to revision it in a separate repo.

Bert Belder

unread,
Aug 2, 2010, 7:54:46 PM8/2/10
to nodejs
> I wouldn't mind including such a package in the node source tree.
Maybe we can eventually include it in the node tree, I think that
would be appropriate. But first let it bake for a while :-)

> I wouldn't mind including such a package in the node source tree. It seems it should include WAF - as that's how you build addons.
I should read the docs I guess. But I don't think people that want to
use a binary distribution are going to build addons themselves?

I'm not sure about what a binary distro should contain and what must
be left out. Also, the script is currently very brittle, it depends on
specific versions of cygwin packages and such. Maybe we can look at
how other projects depending on cygwin deal with these issues; msysgit
seems to include bash etc, so I should really have a look on how they
work.

The bottom line however is that distributing a somewhat official
windows binary build would greatly support the many developers that
(still) develop on windows (like me). Compiling stuff on Linux is
common and often just works; on windows most people don't even bother
to try.

(Some people now feel the urge to tell me that I should be using
VirtualBox/VMWare/whatever. Yeah, I used to do that. But I don't like
it.)
Reply all
Reply to author
Forward
0 new messages