Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript npm Basics (retiring) Installing Packages with npm Managing Dependencies in the package.json File

Aakash Srivastava
Aakash Srivastava
5,415 Points

Managing dependencies

I didn't get the point of dev dependencies and production dependencies which explained from 10:54 to 11:51 .

Any help would be much appreciated.

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Sunny Srivastava ! As Andrew points out in the video, we as developers sometimes need tools to help us develop our app that are not exactly critical to our app being able to run/execute. He uses the example of testing suites. These are used when we (the developers) are testing our code. But those tests don't need to be in our production app. The end user (who may know nothing at all about programming) definitely doesn't need to know exactly how we're testing our app.

Here's a fairly concrete example and a pretty simple one. I use VSCode when programming. There are lots of files and extensions that you can get to help you code. I use one for ES linting. This helps me detect potential problems with my code and even spacing/indentation inconsistencies so that my code has consistent styling. But the style of my code is of zero importance to end users. In fact, my JS is all likely to be minimized to reduce whitespace by the time the end user gets it. Therefore, I really don't need the configuration file for that linting module in there as a dependency for the end product. I only need it for my personal use. It is a "dev" dependency. One that is used by the developer, but not by the end user.

Hope that clarifies things! :sparkles:

Aakash Srivastava
Aakash Srivastava
5,415 Points

Thanks Jennifer Nordell . It helped a lot :)
I asked another question too , and still I don't get any answer .
Because of this doubt , I am stuck at project . I will glad if you can help me