Error: Cannot find where you keep your Bower packages. Use --force to continue
Asked Answered
C

7

21

I'm building an App using MEAN Stack and trying to scaffold my frontend using yeoman-generator, when I do yo angular, it fails to build and ends up in the following:

Running "wiredep:app" (wiredep) task
Warning: Error: Cannot find where you keep your Bower packages. Use --force to continue.
    
Aborted due to warnings.

I found a similar question here, but that solution didn't help me.

My Node version is v0.10.37.

Criminality answered 23/7, 2015 at 5:25 Comment(4)
Pls check after reinstall bower .....Doleful
duplicate of Grunt wiredep:app Cannot find Bower packagesAntherozoid
I tried the steps suggested in that, but no luck :(Criminality
I get this error if my bower_components folder doesn't exist, It can be a permission issue. Try deleting your node_modules,bower_components and do npm install & bower install.. Try them without sudo. if you have .bowerrc file it will specify where to keep bower componentsHowl
A
19

I got the same error on

grunt serve.

It was solved when i tried

npm install --global yo bower grunt-cli 

npm install -g generator-angular

yo angular

grunt serve

if you get an error:-

Running "wiredep:app" (wiredep) task

Warning: Error: angular is not installed

. Try running bower install

Antipodal answered 22/8, 2015 at 7:2 Comment(1)
It has worked for me, thanks! (didn't have to run yo angular)Baroque
H
9

Just run bower install and your code will run.

Heighho answered 6/2, 2019 at 7:32 Comment(0)
A
3

For me it seemed to be link with the rights.
I had to manually create the bower_components folder:

mkdir -m 777 client/bower_components   

and run

bower install
Abercrombie answered 17/8, 2016 at 9:44 Comment(0)
C
2

Put .bowerrc file inside of bower.json file directory.

It must be contain :

{
    "directory": "client/bower_components"
}

It may be your problem.

Carhart answered 7/3, 2016 at 14:46 Comment(1)
This was my problem, I had set the directory as "bower_components" but it should have been "public/bower_components". I mistakenly thought it was assuming the path to be relative from public but it's relative to the location of your bowerrc.Cultivar
B
1

The Node version seems to be outdated and both the npm and nodejs is not installed globally:

To install globally run the following:

npm install --global yo bower grunt-cli 
npm install -g generator-angular

And start again, it will work for sure.

Barbel answered 2/3, 2017 at 5:45 Comment(0)
R
1

I just got the error.

The solution for me was to add the bower_components folder on the root folder even if I did not have bower dependencies yet.

Rosalynrosalynd answered 20/11, 2017 at 19:26 Comment(0)
I
0

For my AngularJS project I had to run this:

npm install
npm run bower

After that my project ran successfully

Indicative answered 17/8, 2021 at 14:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.