How to Safely Update NPM Packages

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ส.ค. 2024
  • NPM Check Updates helps you incrementally and safely upgrade your package.json dependencies to the latest versions. In this video, I walk you through my workflow for using ncu.
    🔗 Key Links 🔗
    - Blog article: chrispenningto...
    - NPM-Check-Updates: www.npmjs.com/...
    ---------------------------------------
    🌐 Connect With Me 🌐
    - Website: www.codinginpu...
    - Blog: www.chrispenni...
    - Twitter: / cpenned

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

  • @lexsemenenko
    @lexsemenenko ปีที่แล้ว +6

    I didn't expect to update my packages this way and easy. Thank you very much!

  • @tonymykhaylovsky7505
    @tonymykhaylovsky7505 11 หลายเดือนก่อน +2

    This gives me a more structured approach to dealing with package upgrades. Makes me more calm about the approach except maybe with the major updates, but confidence will come with time :)

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

      Glad it was a help!

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

    bro you saved me from depression , hahah. I had been stuck for a week with my project throwing all kinds of errors "for no reason", since i hadn't done anything to break my code. I had no idea that npm packages would outdated and throw all these errors. thank you.

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

      So glad it was a help! Thanks for saying something!

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

    I have been waiting for this video all along! Cleared all my doubts!

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

    Is it weird to say I love you? This was awesome! Thanks for the info!

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

      That escalated quickly! Ha! You're welcome

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

    Thank you so much, I was exactly looking for this. Please keep it up

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

    Coming from Shaun channel, leaving a sub :) Great content :)

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

      Thanks for the kind words. Hope you keep enjoying the content!

  • @sarthaktrip99
    @sarthaktrip99 2 ปีที่แล้ว

    great video, this is the easiest way to fix package.json dependencies! We literally spent a whole day fixing 108 dependencies, dependabot auto update is the other way but this is surely the best way to fix dependencies! Thanks again!

    • @CodinginPublic
      @CodinginPublic  2 ปีที่แล้ว

      You’re welcome! Glad it was a help!

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

    Very helpful video and explained in easy way

    • @CodinginPublic
      @CodinginPublic  2 ปีที่แล้ว

      Glad you enjoyed it! Thanks for saying something!

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

    Very helpful! Thank you for sharing! Great channel! Incredible content

    • @CodinginPublic
      @CodinginPublic  2 ปีที่แล้ว

      You’re welcome! Glad you’re enjoying the channel!

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

    Bro you just make my project work! Thank you

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

      Awesome! Thanks for letting me know. Made my day

  • @irfanmohammad7269
    @irfanmohammad7269 6 หลายเดือนก่อน +1

    From react 16.5 to 18 it was my major jump

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

    One thing to be mindful of are peer dependency requirements if you have some framework that relies on you to install stuff it needs (instead of the package itself installing a dependency directly). There can be issues arising from conflicts of poorly-authored peer requirements. An example is in NestJS, where say, you're on version 9, but a third-party package offering a NestJS plugin for some SaaS or whatever requires NestJS versions 7 to 9. This is fine until you upgrade Nest to 10, then the peer dependencies won't resolve because your version is too new, even though in a vast majority of cases it will work just fine. I had this issue with a RabbitMQ NestJS binding that didn't account for the new version, and I could not upgrade the rest to v10 because of that one package until the author updated it. NPM unresolved dependencies are a nightmare to deal with.

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

    bro, you fucking saving my lifeeee! frfr 😭😭😭

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

    this is an amazing way man! love the way you teaching! well, I learned how to get the deal done! amazing. and what about the Vulnerabilities ! are they important? cuz I did audit fix and --force but didn't effected!

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

      They can be important, but it’s nothing you can really fix. It’s up to the packages. So it’s mostly fine to ignore them. Obviously you’re responsible to check out the error if you’re concerned. But that’s most what I do :)

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

      @@CodinginPublic really thanks! I was concerned for two days how to fix them! And now I got it. Thanks man! Best of luck, peace ✌️

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

    Shawn said subscribe, so here I am 😊

    • @CodinginPublic
      @CodinginPublic  2 ปีที่แล้ว

      lol I listen to everything he says, too! 🙌 hope to make it worth your while here :)

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

    After updating npm dependencies my websites hero section is no more responsive (tailwind css used) dont know what to do it broke my website.

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

    Thank you! 👏❤

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

      You’re welcome! I didn't know this at the time, but in more recent versions of NPM there’s actually an update command built in. It’s just `npm update` you can also add the --dry-run tag to see what it WOULD have done. May be more to it than that, but I've since moved over to using PNPM, so I haven't looked carefully :)

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

    Coulnd't figure out how to install npu?? Safe to download this? What is it? Honestly just want to learn how to update ONE SINGLE dependency in list of package.json dependencies. That shouldn't be hard, but is.

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

    Is running ‘npm outdated’ comparable to ‘npx ncu’? It would negate the need to install a redundant package.

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

      I think it’s mostly preference. NPX would bypass that install though, so feel free to stick with that.

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

    How is it different form runing npm outdated and then npm update or npm install specyfic version?

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

      I do believe npm has added some update functionality, but since I'm mostly using PNPM these days, I haven't looked into it. It's very possible that ncu is no longer needed.

  • @felipegutierrez2944
    @felipegutierrez2944 2 ปีที่แล้ว

    Shawn send me here, you have awesome content!

  • @siddiqahmed3274
    @siddiqahmed3274 2 ปีที่แล้ว

    hey, what platform do you use for posting blogs? is it custom build? if it is then please share the tech stack you used...

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

      I've mostly used Hugo for static site blogs, but I'm planning on moving over to Astro to be able to incorporate some React components when needed. Mostly published to Netlify or Vercel.

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

    I need to update some of packages from version 8.x.x to 15 !!! and even patch update brakes some dependencies

  • @1haker
    @1haker ปีที่แล้ว

    IMPORTANT: npm-check-updates requires "node": ">=14.14"

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

    literarly nothing works . keep having error with every commands that you type in . either I don't have permissions or the package has been depricated or the program is outdated!!!!!!

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

      Hmm…it's still working for me. Feel free to pass along the errors your getting and I'm happy to help if I can.

  • @lo1d
    @lo1d 2 ปีที่แล้ว

    What theme you use for zsh

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

      agnoster, I think. github.com/agnoster/agnoster-zsh-theme

  • @aryzhak
    @aryzhak 2 ปีที่แล้ว

    Could you please share your terminal's theme? :)

    • @CodinginPublic
      @CodinginPublic  2 ปีที่แล้ว +2

      Sure, so I'm using zsh with the Agnoster theme and then Monokai pro for VSCode with the Octagon theme variant. Hope that helps!

    • @aryzhak
      @aryzhak 2 ปีที่แล้ว

      @@CodinginPublic For sure! Thank you ^_^

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

    i am gett all these errors

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

    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE could not resolve
    npm ERR!
    npm ERR! While resolving: google-maps-react@2.0.6
    npm ERR! Found: react@17.0.2
    npm ERR! node_modules/react
    npm ERR! react@"^17.0.2" from the root project
    npm ERR! peer react@">=16.0.0" from @ant-design/icons@4.8.0
    npm ERR! node_modules/@ant-design/icons
    npm ERR! @ant-design/icons@"^4.8.0" from the root project
    npm ERR! @ant-design/icons@"^4.7.0" from antd@4.24.10
    npm ERR! node_modules/antd
    npm ERR! antd@"4.24.10" from the root project
    npm ERR! 60 more (@chatscope/chat-ui-kit-react, ...)
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer react@"~0.14.8 || ^15.0.0 || ^16.0.0" from google-maps-react@2.0.6
    npm ERR! node_modules/google-maps-react
    npm ERR! google-maps-react@"^2.0.6" from the root project
    npm ERR!
    npm ERR! Conflicting peer dependency: react@16.14.0
    npm ERR! node_modules/react
    npm ERR! peer react@"~0.14.8 || ^15.0.0 || ^16.0.0" from google-maps-react@2.0.6
    npm ERR! node_modules/google-maps-react
    npm ERR! google-maps-react@"^2.0.6" from the root project
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR!

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

      Hmm. What if you delete your package.json and node_modules, and then run the commands?