Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is causing 'grunt serve' to throw 'No Bower components found'?

I am starting out angular app with angular-fullstack in my Windows 7 box. I installed bunch of npm packages with -g options, including grunt-bower-install. I created the application first by running

yo angular-fullstack appname

There were no exception during the application creation. After application was created successfully I tried to run the app using

grunt serve

expecting the server to run. But the 'grunt serve' failed with

Running "bower-install:app" (bower-install) task Cannot find where you keep your Bower packages.

We tried looking for a .bowerrc file, but couldn't find a custom directory property defined. We then tried bower_components, but it looks like that doesn't exist either. As a last resort, we tried the pre-1.0 components directory, but that also couldn't be found.

Unfortunately, we can't proceed without knowing where the Bower packages you have installed are.

Fatal error: No Bower components found.

I did find .bowerrc file and it was pointing to app/bower_components. Unfortunately, bower_components file was no where to be found. I am not sure what should be the content of the file to create it myself. Is it the missing file causing this problem or is there a npm package, I did not install correctly?

  • I installed bower using npm as well *

Thanks

like image 758
Nair Avatar asked Mar 13 '14 02:03

Nair


3 Answers

Confusingly, the grunt-bower-install task that comes with angular-fullstack doesn't install bower components. It doesn't install anything. This error is trying to let you know that it can't find the bower_components directly, so it can't do its thing.

To fix the issue, run bower install.

If you don't have Bower installed, run npm install -g bower first.

like image 90
James van Dyke Avatar answered Nov 19 '22 11:11

James van Dyke


I had the same issue, here's what worked in my case:

  1. installed ruby and compass (yeoman needs these)
  2. verified that path to Ruby bin folder is added to %PATH%
  3. installed Git
  4. restarted cmd window and ran "bower install" in the app folder

After that, grunt serve command worked perfectly. Note: maybe installing Git and running bower install would suffice in your case.

like image 44
Olga Gnatenko Avatar answered Nov 19 '22 12:11

Olga Gnatenko


I faced the same problem but only did npm install -g bower and then bower install and got grunt serve working.

I did not need to do any of the things mentioned by Olga.

Hope this helps.

like image 12
Pankaj C. Avatar answered Nov 19 '22 13:11

Pankaj C.