首先,请参照如何安装nodejs等
http://blog.csdn.net/rogerjava/article/details/18657219
然后按照bootstrap的文档
Compiling CSS and JavaScript
Bootstrap uses Grunt with convenient methods for working with the framework. It's how we compile our code, run tests, and more. To use it, install the required dependencies as directed and then run some Grunt commands.
Install Grunt
From the command line:
- Install
grunt-cli
globally withnpm install -g grunt-cli
. - Navigate to the root
/bootstrap
directory, then runnpm install
. npm will look at package.json and automatically install the necessary local dependencies listed there.
When completed, you'll be able to run the various Grunt commands provided from the command line.
Unfamiliar with npm
? Don't have node installed? That's a-okay. npm stands for node packaged modulesand is a way to manage development dependencies through node.js. Download and install node.js before proceeding.
Available Grunt commands
Build - grunt
Run grunt
to run tests locally and compile the CSS and JavaScript into /dist
. Uses Less and UglifyJS.
Only compile CSS and JavaScript - grunt dist
grunt dist
creates the /dist
directory with compiled files. Uses Less and UglifyJS.
Tests - grunt test
Runs JSHint and QUnit tests headlessly in PhantomJS (used for CI).
Watch - grunt watch
This is a convenience method for watching just Less files and automatically building them whenever you save.