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
package-lock.json created when updating packages
Anyone know why this file would be created each time I run npm update? Also, I noticed this file is created whenever I run "npm install [filename] --save"
Thanks for your help!
The purpose of that lock-file is to protect your dependencies from change. In that sense, it's like package.json but more robust in its documentation of your dependencies. You can still consider your package.json as your source-of-truth, however, since the contents of package.json will override the lock-file. By default, npm (v5+) will create a lock-file every time you run