I am currently learning Node.JS on my windows machine. I've got my path set up and I've done quite a bit of development already (running all my scripts in cygwin). Finally, it's time for me to run these directly instead of calling 'node --harmony script.js'. The tutorial I'm using says to attach
#!usr/bin/env node --harmony
at the top of the file. Of course, this doesn't exactly work. My path variable says that the node program itself is in:
D:\NodeJS\
I've tried several different ways to use the Shebang to no avail. Every time I run the script, it announces:
./dbcli.js: line 1: #!D:/NodeJS/: no such file or directory
Anyone know how this is supposed to be used? Here's the code so far:
#!d:/NodeJS/node --harmony const request = require("request"), options = { method: process.argv[2] || 'GET', url: 'http://localhost:5984/' + (process.argv[3] || '') }; request(options, function (err, res, body) { if (err) { throw Error(err); } else { console.log(res.statusCode, JSON.parse(body)); } });