Monday, 4 March 2013

Meteor, Blade + Windows 8


Introductions

Meteor is a hot new Node-based web development framework.
Blade is a templating language based on Jade, which is a bit similar to Haml.
Windows 8 is an operating system that no one but me likes.

Installation

I'm assuming you're already up and running with Node.
Meteor isn't officially supported on Windows yet, so you have to install it a bit differently than suggested on their docs. Fortunately, someone has created an .msi installer for us. Run it.
If you haven't done so,
npm install -g blade
. If "npm" isn't a registered command, check your Start Screen for "Node.js Command Prompt" and use that instead of that standard
cmd.exe
. It should have all the paths set up correctly for you.
Now find your
npm/node_modules/blade
and
Meteor/packages
folders. Mine are located at
C:\Users\Mark\AppData\Roaming\npm\node_modules\blade
and
C:\Program Files (x86)\Meteor\packages
respectively.
Inside the
node_modules/blade
folder there should be another folder called "meteor". Copy and paste this in-place to make a duplicate, then rename your copy to "blade". We want to rename it before we move it because there is a folder in the meteor packages called "meteor" already. Now cut-and-paste your new folder into Meteor/packages.
Now go into
npm/node_modules/blade/lib
and copy all the files inside there into your newly created
Meteor/packages/blade
.
Now edit
Meteor/packages/blade/package.js
and change this line:


blade = require('../../packages/blade/node_modules/blade');


To point to the proper node module, e.g.,


blade = require('C:/Users/Mark/AppData/Roaming/npm/node_modules/blade');


That's it.

Adding blade to your Meteor project

Just
cd
into your project folder and
meteor add blade
.
Usage is explained on the official Blade wiki.
(Sorry for the terrible formatting, those are supposed to be inline code blocks... I hate WordPress)

0 comments:

Post a Comment