How do I build backbone boilerplate with grunt?

801 Views Asked by At

I'm trying to build the backbone boilerplate project found here: https://github.com/backbone-boilerplate/backbone-boilerplate

I'm having some issues getting it to build properly. Here are the steps I've done which are the steps on the backbone-boilerplate wiki:

git clone https://github.com/backbone-boilerplate/backbone-boilerplate.git
cd backbone-boilerplate
sudo npm install -gq bower
sudo npm install -q
sudo npm install -gq grunt-cli
sudo grunt

At this point I get:

>> Local Npm module "grunt-cli" not found. Is it installed?
Warning: Task "requirejs" not found. Use --force to continue.

Aborted due to warnings.

Any ideas how to get this to build properly?

3

There are 3 best solutions below

0
ffffranklin On

Specifying depth seems to work:

$ git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate.git
$ npm install
$ grunt

Also you may want to restart your terminal if that is your first time installing grunt-cli

0
tbranyen On

You're running grunt under elevated privileges. Our documentation for building here:

https://github.com/backbone-boilerplate/backbone-boilerplate#build-process

... has you run that command under your own user. Give that a shot!

0
secondman On

You need to ensure you build dependencies with bower, not just the node dependencies.

Getting Started

# Using Git, fetch only the latest commits.  You won't need the full history
# for your project.
git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate

# Move the repository to your own project name.
mv backbone-boilerplate my-project

Updating Dependencies

# Install global dependencies.  Depending on your user account you may need to
# gain elevated privileges using something like `sudo`.
npm install -g grunt-cli bower

# Optionally install coveralls (integration is baked in with Travis CI).
npm install -g coveralls

# Install NPM dependencies.
npm install

# Install Bower dependencies. ** THIS IS THE ONE YOU'VE MISSED **
bower install

Build Process

# To run the build process, run the default Grunt task.
grunt

# Run a build and test the now optimized assets.
grunt default server:release

If you have node installed correctly this should work like a charm.