Skip to content

Instantly share code, notes, and snippets.

@cowboy
Last active December 14, 2015 12:09
Show Gist options
  • Save cowboy/5083960 to your computer and use it in GitHub Desktop.
Save cowboy/5083960 to your computer and use it in GitHub Desktop.
Bocoup jQuery Training

Bocoup jQuery Training

You may use the class materials in two ways:

  1. The easy way - Skip to the Install class materials section at the bottom and follow the first 2 steps. When done, open relevant class materials .js files in your text editor.
  2. The more involved (but more awesome) way - Follow all the directions on this page, starting here:

Install the latest version of Node.js

Node.js is a platform built on Chrome's V8 JavaScript engine that can be run via the command line.

Install Node.js v0.8.11 or newer using a package manager or by downloading an installer from nodejs.org.

You can test to see that Node installed correctly by running both node --version and npm --version via the command line. The npm (Node package manager) version will be different than node's version.

Also note that running node by itself will enter into an interactive mode where you can type JavaScript to be executed. Pressing Ctrl-C twice will exit. Running node file.js will execute the code in file.js.

Accessing the command line

Windows - Open cmd.exe (From the Start Menu, search for "cmd"). When installing npm modules globally, you may need to "Run as administrator," which you can do by right-clicking the cmd name in the programs list.

OS X - Open Terminal.app in /Applications/Utilities.

Linux - You already know how to do this.

Install the Grunt CLI

Via the command line, type npm install -g grunt-cli to install grunt-cli globally. If installed correctly, running grunt --version should output the grunt-cli version.

Windows - If you don't have permission to install grunt-cli globally, cmd.exe may need to be run as administrator.

OS X / Linux - If you don't have permission to install grunt-cli globally, you may need to install it with sudo npm install -g grunt-cli. Type your password when it asks (you'll need to have administrator access for this to work).

If you have problems installing grunt-cli or want to learn more about Grunt, see the Grunt Getting Started guide.

Install class materials

  1. Download the bocoup-training-jquery-2013-03-04.zip class materials archive.
  2. Unzip the class materials file somewhere you have write access.
  3. Via the command line, cd to the created directory (if you don't know how to do this, google it). This directory should contain a package.json npm manifest, a Gruntfile.js Gruntfile, an index.html content index, and other files and directories.
  4. Run npm install to install all the dependencies listed in package.json.
  5. Run grunt to test that all dependencies were installed correctly.

Everything was successful if Grunt prints the message "Now serving Bocoup Training Goodness at http://localhost:8000/"

If errors were encountered, ensure that you have write access to modify the current directory and that the previous npm installs didn't have any errors. In some rare cases, it may be necessary to clean npm's internal caches with the npm cache clean command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment