Bower vs npm: What are the differences?
Bower and npm can be categorized as "Front End Package Manager" tools.
Bower and npm are both open source tools. npm with 17.2K GitHub stars and 3.17K forks on GitHub appears to be more popular than Bower with 15.2K GitHub stars and 1.97K GitHub forks.
reddit, Instacart, and Starbucks are some of the popular companies that use npm, whereas Bower is used by MIT, Bodybuilding.com, and PedidosYa. npm has a broader approval, being mentioned in 2605 company stacks & 2586 developers stacks; compared to Bower, which is listed in 803 company stacks and 393 developer stacks.
What is Bower?
What is npm?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
But one also deals with broken third-party dependencies uploaded to npm way too often (even ignoring the malicious packages issues that have gotten a lot of press of late). And one mostly has to use nvm in order to pin a specific version of node itself in a maintainable way, and nvm is a mess.
We use Yarn because at the time we decided to adopt it, npm had some missing features and issues. We like the speed and determinism provided by Yarn. We could probably use npm at this point, but we have no real reason to switch from Yarn. If you have a convincing argument to switch from npm to Yarn please leave a comment on this decision!
So when starting a new project you generally have your go to tools to get your site up and running locally, and some scripts to build out a production version of your site. Create React App is great for that, however for my projects I feel as though there is to much bloat in Create React App and if I use it, then I'm tied to React, which I love but if I want to switch it up to Vue or something I want that flexibility.
So to start everything up and running I clone my personal Webpack boilerplate - This is still in Webpack 3, and does need some updating but gets the job done for now. So given the name of the repo you may have guessed that yes I am using Webpack as my bundler I use Webpack because it is so powerful, and even though it has a steep learning curve once you get it, its amazing.
The next thing I do is make sure my machine has Node.js configured and the right version installed then run Yarn. I decided to use Yarn because when I was building out this project npm had some shortcomings such as no
.lock file. I could probably move from Yarn to npm but I don't really see any point really.
I use Babel to transpile all of my #ES6 to #ES5 so the browser can read it, I love Babel and to be honest haven't looked up any other transpilers because Babel is amazing.
Finally when developing I have Prettier setup to make sure all my code is clean and uniform across all my JS files, and ESLint to make sure I catch any errors or code that could be optimized.
I'm really happy with this stack for my local env setup, and I'll probably stick with it for a while.
I use npm because I also mainly use React and TypeScript. Since several typings (from DefinitelyTyped) depend on the React typings, Yarn tends to mess up which leads to duplicate libraries present (different versions of the same type definition), which hinders the Typescript compiler. Npm always resolves to a single version per transitive dependency. At least that's my experience with both.
I think our #Frontend stack is pretty standard – but we have taken some deviations from a typical modern stack:
Yarn instead of npm. When yarn debuted, we never looked back. Now npm has pretty much caught up with speed and lockfiles, but yarn gives me confidence that my dependency installs are deterministic. Really interested in the plug-n-play (PnP) feature that removes the need for a node_modules folder, but haven't implemented this yet.
From a StackShare Community member: “I’m a freelance web developer (I mostly use Node.js) and for future projects I’m debating between npm or Yarn as my default package manager. I’m a minimalist so I hate installing software if I don’t need to- in this case that would be Yarn. For those who made the switch from npm to Yarn, what benefits have you noticed? For those who stuck with npm, are you happy you with it?"
Utilize npm private module to package shared library for different React / React Native clients. Shareable code goes here. Basically deliver Redux Store with Firebase integration and business logic in a library. Each React app utilizes this while delivering a device/target specific UI.
If you're using Node or Gulp, you can't help but use NPM in some form or another. Fortunately that's never a bad thing with the massive package repository and glowing ecosystem making it a breeze to work with.
PrometheanTV utilizes Bower in the Broadcast Center Tool to manage 3rd party front end dependencies including things like Angular, Bootstrap, etc.
We manages all of our packages, including Angular JS through npm. It is a very quick way of downloading / installing packages into your project.
Module is published as bpost on the npm registry. Tasks for the module are also defined as npm run tasks with commit hooks for git
Bower was used for a small amount of package management. npm was used everywhere but a few edge cases that only worked with Bower.
It's the front-end version of Composer, so is pretty essential to pull in packages that can be tracked and kept up to date.
It easily for me to have this kind of technology. She allow me to manage my front-end package
To provide any vendor modules used within the frontend build, mainly AngularJS libraries.