I'm new to node and using npm to both do some node, angular and Express tutorials. I have used bower before in a tutorial. I'm pretty sure I have installed it using -g already as when i run the bower -v
command I get back 1.3.3
I am to understand that installing it using -g means, Install this globally so that on the next project I don't have to install it again.
1) Is this correct?
2) When I start working with a new project do I have to initialize bower?
3) Is there any reason I should use install bower --save-dev
after I have already installed bower (-g)lobally?
4) What exactly does install bower --save-dev
do?
I have searched and get nothing on google or stack over flow when I search "--save-dev".
I really want to understand this and if you help me, it will help me understand installing much more than just bower and how to use those installs. Again, I'm new to the command line for this type of development and new to these technologies, but have some basic understanding.
As of npm 5.0. 0, installed modules are added as a dependency by default, so the --save option is no longer needed.
It has a very frequently used command npm install [Package Name] –save. But the fact is there is no difference between npm install [Package Name] and npm install [Package Name] –save in the later version after npm 5.0. 0 onwards.
npm install [package-name] –save-dev: When –save-dev is used with npm install, it signifies that the package is a development dependency. A development dependency is any package that absence will not affect the work of the application.
Using the --save
and --save-dev
flags when installing will add them to the project's package.json
. This allows anyone who might develop on or use the project to install the dependencies as needed with a simple npm install
command. By contrast, the -g
flag is global only to your local machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With