What is NPM's package-lock.json?
HTML-код
- Опубликовано: 23 авг 2024
- I was minding my own business trying out npm install. It was going so well, then this weird package-lock.json file appeared.
It just kind of turned up uninvited.
Turns out that npm adds this file automagically, to represent the versions of all the packages installed in node_modules.
But what's the point of package-lock.json and how do you use it?
🦸 GRADLE HERO COURSE tomgregory.com...
🚀 FREE INTRODUCTORY GRADLE COURSE tomgregory.com...
▶️ Watch me next
Gradle Was Hard Until I Learnt This INSANE Secret • Gradle Was Hard Until ...
10 Tips To Use Gradle With IntelliJ IDEA In 2022 • 10 Tips To Use Gradle ...
🌍 Read more about npm on my website tomgregory.com...
💌 Sign up to my monthly newsletter tomgregory.com...
For years I've had the lock file my project and finally bit to bullet to try and understand what it is. This video couldn't make it any clearer. Thank you so much!
This way you presented this video is incredible; incredibly informative & clear and straight to the point - in 3 mins you answered all my questions better than all the stack overflow questions I've read over the last few years. Incredible channel 🙏
Great video, you explained it so accurately. Cleared a lot of blur about the package-lock json file. You should make more videos.
The presentation and the conceptual clarity of the video is unbelievable. Thank you.
You're very good at this! Quality content, great editing, great humor.
really appreciate the video . Keep it up 👍
thanks bud, I finally understand wth package-lock is
Simple, Clear and Good
I really appreciate your efforts to produce such an amazing video :)
great informative video with some comedic scenes. I think you will fit perfectly as voice over
Awesome bro, I watched some videos on the same and thought of the same question why would ^ be in the package.json and lock.jason file exist together but no one mentioned the same except you.
beautiful answers explained nicely
omg thx u
thank you so much!
Should we ever delete lock file? How will it affect dependencies ?
Amazing content !😊
There's no reason to delete it. You might get different dependency versions to someone else using the same repo.
@@TomGregoryTech thank you so much 😊
gracias amigo
But what about the fact package-lock.json also has ~ and ^?
It would just then NOT install the exact version of packages...
Jesus Bob you have a talent to speak outside of topic....I hope your mom will cut your access to internet ;)
Why didn't npm just change the functionality of "npm install"... which installs and automatically updates
... to just "install"... without the automatic update
And if you want to update the packages... you use the "npm update" command
... like you do now?
I don't get it.
I know lock files from the various package managers of Ruby, Python and NodeJS.
A similar functionality exists for Gradle (Locking dependency versions in the user guide). Why seems to be so little talk about that? Why don't you - as the Gradle guy - talk about it or mention the parallels in this video?
Are the other Gradle mechnisms prefered over locking dependencies? I honestly don't understand why this feature seems to be so unpopular for Gradle.
Oh. OH! Oh wow. Okay. THEN WHY DON'T THEY JUST SAY SO- /sigh. Thank you for the video.
too many useless content. Get to the point. make it concise.
Weak explanation