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

Carrie Happoldt
Carrie Happoldt
15,160 Points

Why does "npm install" install all of the npm files, even ones I haven't specified

when I use the command "npm install --python=python2", my new node_modules folder has 30 to 40 other folders in it. The same thing happens, even if I use "NODE_ENV=production npm install". I know that all I should see is the bcrypt and colors packages. Anyone know what command I missed early on to have this happen? OR Is this how is should be with different versions? Thanks

1 Answer

Shawn Rieger
Shawn Rieger
9,916 Points

bcrypt and colors have dependencies of their own. The packages they depend on must be installed as well in order for them to work properly. Don't worry so much about what npm does with the node_modules folder, best to let npm worry about that :)

This changed in the NPM 3.0.0 release. If you prefer the legacy bundling you can use the following:

npm install --legacy-bundling