nodejs-1024x768

Getting started in developing Node.js in Windows

As a Microsoft Stack engineer (Windows Server, IIS, SQL, .Net…. WISN?) my tool kit normally consists of SQL Server Management Studio, Visual Studio 2013, IIS, and a Windows workstation. But recently, I wanted to play a bit with Node.JS and see what the hype is about. In short, it’s pretty cool, I was able to set up a Node application in almost no time, thanks to a wonderful Dev Day session during Philly Tech week, From Zero to 80: Your First Node.js Web Application led by Andrew Theken of NodePhilly.

Of course, the session was led in OSX, and I had to scramble to get some tools together, but I found some neat options.

Setting up your environment

Prerequisites: I’m using a Windows 8.1 machine, which has never had Node.JS installed, at all. I have VS2013 installed, but I will be foregoing it for now.

Step 1: Install Node.JS

Node.JS isn’t native on any environment, so to begin, let’s head over to  http://nodejs.org/, and install Node.JS for Windows.

Oh my god, it even automatically detects your OS and gives you a 1 click link

Look how simple it is to install Node.JS
Look how simple it is to install Node.JS

Normally, if you are familiar with creating a .Net application, you create a new project/solution, write some code, or look at the sample, and hit play.

Yea, this isn’t happening……..

Well, let’s look at what you have

Node.JS start menu options
Node.JS start menu options
  • Clicking Node.js brings up a blank command prompt with a >
  • Clicking Node.Js command prompt brings up a command prompt
  • The next two link to documentation
  • And finally you can uninstall, walk away, and cry.

Let’s assume you aren’t ready to cry yet.

Step 2.1: Hello World

I’m going to go on a limb, and create a sample project directory, and try to spin up a hello world application.

I began by creating a folder for my project, and opening up my trusty Notepad++ editor and creating hello.js (I assume that since we are working with Node.JS, the files being executed are .JS, am I right??)

[js]

console.log("Hello World");

[/js]

Ok, I have a file, hello.js, and inside I am writing Hello World to the console. If this is new to anyone, I suggest you check out some beginners guides, I love Tizag Tutorials, that is where I got started,

Step 2.2: Execute

How do I…? Where’s the play button?

Perusing through the Node.JS documentation, I see that in order to execute a Node application, I open the Node.JS command prompt, navigate to my file, and type

[js]

node hello.js

[/js]
Node.JS Hello World
Node.JS Hello World

Notepad++ has tons of extra goodies, especially when you start adding plugins.

One such plugin I came across was NppExec, which allows you to execute commands/scripts within N++. Sounds like just what we need.

NPPexec - NotePad++ Plugin
NPPexec – NotePad++ Plugin

 

Originally appeared on AltifySoftware.com

Getting started in developing Node.js in Windows

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>