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 trialjlampstack
23,932 Pointspackage-lock.json
Why does the package keep downloading this package-lock.json file? It doesn't show this file in Andrew's folder structer.
2 Answers
Rich Donnellan
Treehouse Moderator 27,696 PointsThe package-lock.json
was first introduced in npm 5. Per the docs:
This file describes an exact, and more importantly reproducible node_modules tree. Once it's present, any future installation will base its work off this file, instead of recalculating dependency versions off package.json.
I can safely deduce this course was recorded before npm 5 was released. Thus, package-lock.json
hadn't existed yet.
Ross McIvor
1,122 PointsDon't worry about this file, it is only added because your version of NPM is more recent than when this was recorded :)
Greg Schudel
4,090 PointsGreg Schudel
4,090 PointsSo lemme get this straight...we DONT need package.json now? All we need is package.lock? I have package-lock.json in my editor (i'm using Sublime Text), will that suffice?
Rich Donnellan
Treehouse Moderator 27,696 PointsRich Donnellan
Treehouse Moderator 27,696 PointsYou absolutely need
package.json
. Thepackage-lock.json
is optional and is generated based on thepackage.json
dependencies.