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 trialJason Martin
Courses Plus Student 9,316 Pointsnpm install express --save-exact
after install I typed "ls node_modules" and I see about 40 items with express being one of them...I noticed you only came out with express.
What did I do wrong here?? I typed npm install express --save-exact
3 Answers
Matt F.
9,518 PointsHello Jason,
You are not doing anything wrong - those other modules are Express's dependencies. Much like your app will have Express as a dependency - Express itself depends on other libraries/modules.
If you go here, scroll down and you will see on the right side that Express has 25 dependencies - some of which might have their own dependencies.
Jason Martin
Courses Plus Student 9,316 PointsGreat thanks, just got confused because the video only displayed express when the instructor typed out ls node_modules.
Israel Mabhoo
16,356 Pointsnpm install express@4.15.2 --save
vikram 11023
12,043 Pointsnpm install express@4.15.2 -- save
Ken Howard
Treehouse Guest TeacherKen Howard
Treehouse Guest TeacherThere's a note in the teacher's notes that talks about an error in the videos regarding
--save-exact
. This flag is only useful when used in conjunction with the--save
or--save-dev
flag. For instance, you should install Express like this:npm install express --save --save-exact
Doing this will add the dependency to your project's package.json file and ensure the version number is static (does not begin with ^ or ~ and does not include an x or *). You can learn more about the nuances of npm's versioning system here: https://github.com/npm/node-semver#advanced-range-syntax