- Install Node.js from http://nodejs.org
- Open a Command Prompt and run
"c:\Program Files\nodejs\npm" install -g learnyounode
- Run
C:\Users\USERNAME\AppData\Roaming\npm\learnyounode.cmd
where USERNAME is your Windows login name. - Instead of writing code in Notepad, I recommend Notepad++ with the NppExec plugin, this F6 script:
NPP_SAVE
CD $(CURRENT_DIRECTORY)
C:\Program Files\nodejs\node.exe "$(FULL_CURRENT_PATH)"
And these Shift+F6 HighLight filters with Red set to FF:
%ABSFILE%:%LINE%
* (%ABSFILE%:%LINE%:%CHAR%)
Doubleclicking highlighted output in the Notepad++ console will focus on the bug.
- Check examples in a relevant client like your web browser for the main example:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
A reboot might help with not having to specify the location of the executables.