Gabriel Smoljár Gabriel Smoljár - 1 year ago 128
Linux Question

Node.js development, windows or linux?

I'm interested in web development on the Node.js platform. My host OS is Windows 7. What would be the preferd way to set up a development environment. Run it directly on the host or in a linux based virtual machine? What are the pros and cons between these two methods?

If I go with a VM, can I still run the text editor and web browser in Windows (for performance reasons)?

Answer Source

We have a system via which we just use a config file, which handles all our problems like path differences ("c:\blarg" vs "~user/blarg") and, as a bonus, lets us control differences between debug and production environments.

Node.js is cross platform, so we totally have developers working on all sorts of computers, and it's no problem at all.

This is an example config file I use on a file storage project:

 * All of these are mandatory except for log_level (which defaults to "info", 1) 
 * and log_echo_to_console (which defaults to false)
exports.config = {
    log_level: 0,
    log_file: "/path/to/send.log",
    request_log_file: "/path/to/send_requests.log",
    log_echo_to_console: true,
    port_number: 8088,
    no_notification_emails: true,
    image_url_base: "",      // MAKE SURE THIS ENDS IN "/"
    s3_info: {
        key: 'xxxxxx',
        secret: 'yyyyy',
        file_bucket: 'sendtransfer/',
    backend_info: {
        db_info: {
            server: "localhost",
            user: "db_user",
            password: "secret",
            database: "SendRemote",
            pooled_connections: 125,
            idle_timeout_millis: 30000
        memcache_info: {
            host: "",
            port: "31111",
            pooled_connections: 200,
            timeout: 20000

    debug_server: true

For Windows machines, just change the paths. It's all good!

Then in code, you can just type:

var local = require('local.config.js');
// etc

Embrace multiculturalism!!!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download