2

I cloned purecss project to my desktop and tried to run grunt on it since I saw there is a gruntfile included.

Running "bower-install" task
Warning: Cannot find module 'bower' Use --force to continue.

Of course a saved a local grunt to project folder as well as all the necessary plugins.

The problem should be with bower, I have to admit I never used it, but I ran a npm install -g bowerin terminal just in case, but no change.

The bower install task from gruntfile.js:

// -- Bower Tasks --------------------------------------------------------------

grunt.registerTask('bower-install', 'Installs Bower dependencies.', function () {
    var bower = require('bower'),
        done  = this.async();

    bower.commands.install()
        .on('log', function (data) {
            if (data.id !== 'install') { return; }
            grunt.log.writeln('bower ' + data.id.cyan + ' ' + data.message);
        })
        .on('end', function (results) {
            if (!Object.keys(results).length) {
                grunt.log.writeln('No bower packages to install.');
            }

            done();
        });
});
Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
aegyed
  • 1,320
  • 3
  • 20
  • 39
  • Not sure, but i think you need to install bower in your project dir: `npm install bower --save-dev`. So without the global param. – asgoth Oct 08 '13 at 13:05
  • Did you try just `npm install` in your project dir? Because the package.json file should have all it needs. – asgoth Oct 08 '13 at 13:07

1 Answers1

0

Probably you did not run npm install in your project directory.

npm install will install all dependencies defined in package.json, which contains your bower module too.

asgoth
  • 35,552
  • 12
  • 89
  • 98