Running NowJS natively on Windows
- Edit
- Delete
- Tags
- Autopost
Node.js v0.6.0 marked the first stable release of a native Windows build of Node.js, so for all the Windows users out there, Node in Cygwin should be a thing of the past!
NowJS on Windows
- Install node.exe and NPM for Windows and make sure all your paths are correct
- Install Microsoft Visual C++ Runtime (4.8 MB)
- Download the NowJS Windows branch zip or `git clone git://github.com/Flotype/now.git` and `git checkout windows`
- Rename `Flotype-now-XXXXXX` to `now` and put that in your node_modules folder
Congrats! You should now be able to `require('now')` from your app as long as the node_modules folder is in the path.
What's different in the NowJS Windows branch?
The only difference is in proxy.js, insteading of `require('node-proxy')` we `require('../bin/proxy.node')`
proxy.node is the compiled Windows binary of the node-proxy module and included as part of the Windows branch of NowJS.
Why has it taken so long to get NowJS working on Windows native?
In order to provide the `now` namespace functionality, we use the node-proxy plugin. Unfortunately node-proxy is a C++ V8 extension and thus requires compilation. With the release of Node v0.6.0, the toolchain for native module compilation for Windows was undocumented. This meant that we weren't able to compile the node-proxy dependency for NowJS. Several workarounds were proposed including using native harmony proxies found in current V8 builds (when run with --harmony_proxies flag). Unfortunately the current V8 implementation seems to contain a bug preventing correctly triggering setters when dynamic properties names are given (See code.google.com/p/v8/issues/detail?id=1543#c10). Eventually we settled on compiling node-proxy in Visual C++ and distributing that.
Happy hacking!