Express & Express CLI Generator Setup at 4.0
This whole Node.js and Express thing, I am pretty new to it. Once I figure out how to get it working, I am sure it is going to be positively outstanding. This part however, is proving to be somewhat difficult since Express recently updated to version 4.x recently. As with any project following semantic versioning, a full dot-0 release means no backward functionality. I get it. Heck, I work for a software company. Right now though, the road is a little bumpy since most of the tutorials scattered across the web are for prior 3.x versions.
Even getting started proved to be a little more difficult than I anticipated. Express is has this really nice command line generator for new projects. Apparently, so far as I can tell from old tutorials, this was included in 3.x versions of Express. However, although this functionality has not gone anywhere, it now requires a second install.
To install both Express and the command line generator, first make sure you have Node installed. Next, enter the following into the command line.
npm install -g express express-generator
You will see a long waterfall of text. Once finished, navigate to where you want to store the directory containing your shiny new project and type the following to get started with a scaffolded out Express project with support for Jade templating.
npm express -e newProject
This will create a directory called newProject, put some files in there and use NPM to download and install dependencies. Once finished, you can start editing and test your new project as you would expect.