Hao
Hao

Reputation: 6609

What is the difference between Node Package and Bower Package?

Taking Ember App for example. ember install ember-bootstrap-4 will add node package. But bower install tether --save will add bower package. Both are part of the app. But why one is in bower and one is in npm?

Upvotes: 2

Views: 735

Answers (2)

Tu Hoang
Tu Hoang

Reputation: 11

npm and bower are both packages manager in your Ember application but there are some differences in using them:

  • Bower is only used in front-end. It will download bower package into your Ember project (bower_component folder) and you still have to add it to your app's assets. For example, if you install moment package in bower, you have to add it to your app by going to ember-cli-build.js and add the following line app.import('bower_components/moment/moment.js'); (view more details in Ember Addons and Dependencies)
  • NPM is used for server packages. It will download packages into node_modules project. Every ember-cli addons is in npm and when you type ember install <addons-name>, ember will look up for ember addon, place your addon's info in package.json and download it in node_modules folder. Then, Ember will load it automatically for you.

Upvotes: 1

Ember Freak
Ember Freak

Reputation: 12872

bower install - is for including run time dependencies and you need to import it in ember-cli-build.js to use.

npm install - is for including development/build time dependencies.

Upvotes: 0

Related Questions