Shlomo
Shlomo

Reputation: 3990

bower_components created at wrong directory

Using Windows 7, Webstorm 10.0.1, current node.js, npm, bower, etc.

I created the default Webstorm AngularJS project, did not change anything and clicked "Run index.html". The page loaded but Angular was not running. From the source I saw that the files were missing <script src="bower_components/angular/angular.js"></script>. The directory bower_components was missing. Then I searched for it and it was created at C:\Users\<username>\bower_components whereas my Webstorm projects are under C:\Users\<username>\WebstormProjects\angularjs.

What configurations need to be changed to make my AngularJS app work?

Additional info:

.bowerrc

{
  "directory": "app/bower_components"
}

bower.json

{
  "name": "angular-seed",
  "description": "A starter project for AngularJS",
  "version": "0.0.0",
  "homepage": "https://github.com/angular/angular-seed",
  "license": "MIT",
  "private": true,
  "dependencies": {
    "angular": "1.2.x",
    "angular-route": "1.2.x",
    "angular-loader": "1.2.x",
    "angular-mocks": "~1.2.x",
    "html5-boilerplate": "~4.3.0"
  }
}

Upvotes: 3

Views: 1563

Answers (2)

Kangcor
Kangcor

Reputation: 1189

You need to edit .bowerrc in the root of your project folder and set the directory you want to use:

{
  "directory" : "public/bower_components"
}

More info in Bower docs

Upvotes: 1

Satyam Koyani
Satyam Koyani

Reputation: 4274

May be you are missing to install dependencies here.

In your project you have a bower.json file present. Go to that directory and run bower install command. This command will install all the specified dependencies of your project which is mentioned in bower.json

Upvotes: 5

Related Questions