Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Creating a Built in Task

npm install

when I execute the command npm install, for some reason, workspace installs many unnecessary node_moduels. You can see what have been installed in the link below:

https://w.trhou.se/wimic0oaan

2 Answers

Neil McPartlin
Neil McPartlin
14,662 Points

I clicked the link and found that Kangin has the same number of packages as me which is 35 but there is a good reason for this. We are not only installing 2 packages 'mocha' and 'uglify.js', but each of these have their own dependencies too.

Look at both of these links and part way down on the right, those (sub) dependencies are listed.

https://www.npmjs.com/package/mocha

https://www.npmjs.com/package/uglify-js

It's true that at the time of writing, those sub dependencies add up to just 12 but note that both have had major releases in the past 2 years since this video was made, so dependencies are either no longer required or have been incorporated into the main package.

I didn't click on your link but, i think i had the same problem. My workspaces kept crashing because there was too many node modules. So I asked one of the treehouse team members and they told me to just delete the unwanted modules.