What is NPM's package-lock.json?

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 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...

ความคิดเห็น • 30

  • @FengolZA
    @FengolZA 3 หลายเดือนก่อน

    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!

  • @reidmoffat7055
    @reidmoffat7055 ปีที่แล้ว +1

    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 🙏

  • @krishnakandula6587
    @krishnakandula6587 ปีที่แล้ว +1

    The presentation and the conceptual clarity of the video is unbelievable. Thank you.

  • @JamesQQuick
    @JamesQQuick 10 วันที่ผ่านมา

    Great explanation. Love the overall video as well. Fun stuff!

  • @VidyaHarnal-r9y
    @VidyaHarnal-r9y ปีที่แล้ว +2

    Great video, you explained it so accurately. Cleared a lot of blur about the package-lock json file. You should make more videos.

  • @snake1625b
    @snake1625b 19 วันที่ผ่านมา

    Great explanation! It seems like the lock also includes the versions of the sub dependencies as well

  • @iurysza
    @iurysza ปีที่แล้ว +1

    You're very good at this! Quality content, great editing, great humor.

  • @poppin_party
    @poppin_party ปีที่แล้ว +1

    thanks bud, I finally understand wth package-lock is

  • @sundarraj9384
    @sundarraj9384 11 หลายเดือนก่อน

    Simple, Clear and Good

  • @Ahmed-fq3kz
    @Ahmed-fq3kz ปีที่แล้ว

    great informative video with some comedic scenes. I think you will fit perfectly as voice over

  • @rajatguleria4933
    @rajatguleria4933 ปีที่แล้ว +1

    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.

  • @aakashpatel9281
    @aakashpatel9281 4 หลายเดือนก่อน +1

    really appreciate the video . Keep it up 👍

  • @aben5960
    @aben5960 ปีที่แล้ว

    I really appreciate your efforts to produce such an amazing video :)

  • @harshasinha5499
    @harshasinha5499 7 หลายเดือนก่อน

    beautiful answers explained nicely

  • @RavenFelman
    @RavenFelman ปีที่แล้ว +1

    thank you so much!

  • @randalljosue
    @randalljosue 10 หลายเดือนก่อน

    But what about the fact package-lock.json also has ~ and ^?
    It would just then NOT install the exact version of packages...

  • @prabhsharansingh6150
    @prabhsharansingh6150 หลายเดือนก่อน

    Too good!

  • @GregorGramlich
    @GregorGramlich ปีที่แล้ว +1

    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.

  • @lightoo4343
    @lightoo4343 ปีที่แล้ว

    Should we ever delete lock file? How will it affect dependencies ?
    Amazing content !😊

    • @TomGregoryTech
      @TomGregoryTech  ปีที่แล้ว +1

      There's no reason to delete it. You might get different dependency versions to someone else using the same repo.

    • @lightoo4343
      @lightoo4343 ปีที่แล้ว

      @@TomGregoryTech thank you so much 😊

  • @user-ed1jc6xl9r
    @user-ed1jc6xl9r 7 หลายเดือนก่อน +1

    omg thx u

  • @b25671
    @b25671 ปีที่แล้ว

    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.

  • @valikonen
    @valikonen หลายเดือนก่อน

    Jesus Bob you have a talent to speak outside of topic....I hope your mom will cut your access to internet ;)

  • @RichardRebeco
    @RichardRebeco ปีที่แล้ว

    gracias amigo

  • @Draconicrose
    @Draconicrose 2 หลายเดือนก่อน

    Oh. OH! Oh wow. Okay. THEN WHY DON'T THEY JUST SAY SO- /sigh. Thank you for the video.

  • @pstha4537
    @pstha4537 ปีที่แล้ว +4

    too many useless content. Get to the point. make it concise.

  • @Markus-iq4sm
    @Markus-iq4sm ปีที่แล้ว

    Weak explanation

  • @ShoaibBinAllahBakhsh
    @ShoaibBinAllahBakhsh 20 วันที่ผ่านมา

    console.log("Excellent explanation");