How to Safely Update NPM Packages

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 59

  • @tonymykhaylovsky7505
    @tonymykhaylovsky7505 Рік тому +3

    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 :)

  • @lexsemenenko
    @lexsemenenko 2 роки тому +6

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

  • @InglesporMinutoconAnthonyMartz

    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!

  • @joweltisso7365
    @joweltisso7365 10 місяців тому

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

  • @tyler785
    @tyler785 2 роки тому +1

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

    • @CodinginPublic
      @CodinginPublic  2 роки тому +1

      That escalated quickly! Ha! You're welcome

  • @pushpanjalisingh9695
    @pushpanjalisingh9695 2 роки тому +1

    Very helpful video and explained in easy way

    • @CodinginPublic
      @CodinginPublic  2 роки тому

      Glad you enjoyed it! Thanks for saying something!

  • @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!

  • @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!

  • @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

  • @anj000
    @anj000 10 місяців тому +1

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

    • @CodinginPublic
      @CodinginPublic  9 місяців тому

      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.

  • @gosnooky
    @gosnooky 10 місяців тому

    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 9 місяців тому

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

  • @irfanmohammad7269
    @irfanmohammad7269 9 місяців тому +1

    From react 16.5 to 18 it was my major jump

  • @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 :)

  • @maxvegra4628
    @maxvegra4628 2 роки тому

    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  2 роки тому +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 2 роки тому

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

  • @bodaravindar9744
    @bodaravindar9744 7 місяців тому

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

  • @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.

  • @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 :)

  • @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 2 роки тому

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

  • @jackpitts5561
    @jackpitts5561 7 місяців тому

    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.

  • @1haker
    @1haker 2 роки тому

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

  • @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 ^_^

  • @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.

  • @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?