54

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

Nair
  • 7,438
  • 10
  • 41
  • 69
  • 17
    run `bower install` from root directory of your app... it will install dependencies to app/bower_components and it should work – doodeec Mar 13 '14 at 06:58
  • 3
    I ran bower install, consequently it throw "bower ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/angular/bower-angular.git, exit code of #128" , I had to run --> git config --global url."https://".insteadOf git:// then run --> bower install resolved the issue. – yantaq Mar 28 '14 at 00:44

9 Answers9

70

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.

James van Dyke
  • 4,790
  • 3
  • 28
  • 25
44

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.

uladzimir
  • 5,639
  • 6
  • 31
  • 50
Olga Gnatenko
  • 790
  • 1
  • 11
  • 14
  • 1
    I also needed Ruby and Compass (specific version as per http://stackoverflow.com/questions/22554220/compass-error-for-command-grunt-server ) to get grunt serve working. – mekondelta Apr 01 '14 at 10:34
  • 3
    Worth precising, you need to install bower – Cyril CHAPON Aug 25 '15 at 07:48
  • Specifically, you should only need Ruby and Compass if you choose the (default) sass option when you run the generator. I have it working just fine without either. – Hilton Shumway Apr 19 '16 at 18:50
12

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.

Pankaj C.
  • 139
  • 1
  • 6
5

npm install -g bower doesn't install bower components, you should run as well bower install to have all bower's components installed and then run grunt serve. It should work fine

Iliass
  • 527
  • 2
  • 6
  • 13
3

Try to do bower install. If its failing saying not able to connect to git then you can change repo pointing location by simply running below command

$ git config --global url.https://github.com/.insteadOf git://github.com/ 

This will ensure that you will be downloaded over https instead of git if its causing orginasation firewall to block it.

Anup B
  • 87
  • 7
1

In my case, I added sudo for it to work. So, I ran sudo npm install -g bowerand then bower install. grunt serve then worked when I ran it.

iamapj
  • 11
  • 1
1

The Bower installation requires the packages to be brought from the Git repository, so first you need to install the Git application in your system. You can download it from this link :https://git-scm.com/downloads . Now after your have downloaded it , there may be a chance that the PATH may not be set up, so go to ControlPanel -> System and Security -> System -> Advance System Settings (on the left-hand side), click it, then goto Environment Variables -> System Variables -> PATH , click edit , and write down the following paths :

;C:\Users\admin\AppData\Local\Programs\Git\bin; C:\Users\admin\AppData\Local\Programs\Git\cmd ....Well the above path is where Git was installed in my system, you can crawl to the place in your system where Git was installed and select the paths from the "bin" and "cmd" folder and paste it on the PATH variable.

Now, after the GIT path is setup, you can now type in the command " $ bower install " , this will install all of your bower packages.

1
npm install -g bower
bower install
grunt serve

worked for me ...

dur
  • 15,689
  • 25
  • 79
  • 125
-1
npm install -g bower
bower install
grunt serve

It's worked too

Liam
  • 27,717
  • 28
  • 128
  • 190
Nina
  • 1