Index
ed
Search videos...
⌘
K
Search videos
Search across video titles, descriptions, and transcripts
package-lock.json file explained | Traversy Indexed
Back
package-lock.json file explained
Aug 29, 2025
beginner
Project Build
Hide Transcript
0:00
All right, guys. So, what the hell's
0:01
with this package-lock.json
0:03
file that keeps showing up in your
0:05
projects? So, you're working on a node
0:07
project. You install some packages with
0:09
npm and boom, this massive file appears.
0:12
Should you commit it, delete it? What's
0:13
it even doing? So, here's the deal. When
0:16
you run npm install, npm looks at your
0:18
package.json for dependencies. But
0:21
here's the problem. If I say I want
0:23
React version carrot 18.2.0,
0:27
that could install 18.2.5. 2.5, 18.2.8,
0:31
whatever the latest patch is. So,
0:33
package lock.json locks down the exact
0:36
version that got installed and every
0:38
single dependency, every subd dependency
0:41
gets pinned to a specific version. Why
0:43
does that matter? Because when your
0:45
teammate clones your repository, when
0:48
you deploy to production, npm reads this
0:50
lock file first. Everyone gets the
0:53
identical dependency tree, and there's
0:55
no more works on my machine nonsense.
0:58
And yes, always commit your package
1:00
lock.json.
Related Videos
1:36
Understanding CORS
Oct 11, 2025
intermediate
Live Stream
1:25
React server components
Aug 31, 2025
intermediate
Quick Tip
36:19
Encore Crash Course - TypeScript Backend Framework & Toolset
Sep 2, 2024
intermediate
Crash Course
1:46:11
Express Crash Course
May 7, 2024
intermediate
Crash Course