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 npm Basics (retiring) Installing Packages with npm Managing Dependencies in the package.json File

Alex Flores
Alex Flores
7,864 Points

I don't understand the --python=python2?

I don't understand why --python=python2 knows to download bcrypt? Also, there are other packages in the package.json file, will this load them as well?

1 Answer

Benjamin Barslev Nielsen
Benjamin Barslev Nielsen
18,958 Points

It is not the --python=python2 that tells npm to download bcrypt. Below is the npm command to install bcrypt

npm install bcrypt --python=python2

The npm install bcrypt part tells npm to install that package, but bcrypt depends on a python version between 2.5 and 3.0 and python in workspace is version 3.4.1, i.e., the python command refers to a wrong version. In workspace python2 refers to python version 2.7.5, so therefore we need to tell npm that it should use python2 instead of python. That is exactly what

 --python=python2

means.

Alex Flores
Alex Flores
7,864 Points

You the man Benjamin! Thanks!