Friday, February 28, 2014

Adventures in Node.js - Using NPM on Windows

The following still needs to be more carefully verified but I'm making this public now to help someone and hopefully do just that....


We'll call this installment #2 of "Adventures in Node.js" even though my previous Node entry didn't have this in mind.

I'm short on time today so I can't elaborate so much but in short:

One time on your machine:

  1. Install Python 2.7 and add the python.exe folder location to your PATH environment variable.
  2. Either 1 or 2 depending on your setup:
    1. If you don't have Visual Studio 2008 installed (which provides vcbuild.exe):
      1. install the Windows SDK (to provide vcbuild.exe). Good reference at https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup then ensure that the path to vcbuild.exe is in your PATH environment variable
      2. npm install -g socket.io --msvs_version=2012
    2. If you DO have VS installed, run the following to setup your environment properly:
      1. Add the path to vcbuild.exe to your PATH environment variable then run the following
      2. npm install -g node-gyp
      3. node-gyp configure --msvs_version=2012
      4. node-gyp build
      5. npm install -g socket.io --msvs_version=2012

Once for your project:
  1. npm install
Now your project should be ready for you to use npm in general. My purpose today was to check out grunt, grunt-cli and grunt-devtools thanks to recommendations from Paul Irish both at Google I/O 2013 and a couple weeks ago at the Chrome Dev Summit.

Now that I have npm working it was as simple as (from http://gruntjs.com/getting-started#preparing-a-new-grunt-project):
  1. npm install -g grunt-cli
  2. npm install grunt --save-dev
  3. npm install grunt-devtools
Next I try to setup and use Yeoman (another framework he suggested that relies on Grunt).

0 comments :

Post a Comment

Followers