isrcca
Last Updated: September 20, 2018
·
14.39K
· calamari

Install npm packages with --save or --save-dev

I am not quite sure since when npm has this arguments and why I missed that, but they are really great.

If you npm install something with --saveor --save-dev, it will not only install it, it will also put it in the right place within your package.json file.

So, go ahead and try for example this one:

npm install express --save 

And you will see it put "express": "~3.4.4" at the end of the dependencies block within your package.json. It will always use the ~ notation with the full version number, so you will not have problems reinstalling the same version again on different systems.

Or put the dependcy into the devDependenciessection:

npm install supertest --save-dev

If you write a new application and are trying out differnt npm packages, it really is a time safer.

1 Response
Add your response

30750

If you are interested in windows 10 tutorials then you just click at http://taskbarwindows10.com and know about how to pin taskbar in windows 10 completely free of cost.

about 2 months ago ·