You may use the class materials in two ways:
- 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. - The more involved (but more awesome) way - Follow all the directions on this page, starting here:
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
.
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.
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.
- Download the bocoup-training-jquery-2013-03-04.zip class materials archive.
- Unzip the class materials file somewhere you have write access.
- Via the command line,
cd
to the created directory (if you don't know how to do this, google it). This directory should contain apackage.json
npm manifest, aGruntfile.js
Gruntfile, anindex.html
content index, and other files and directories. - Run
npm install
to install all the dependencies listed inpackage.json
. - 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.