WOW! I'm currently going through that phase of updating my project's dependencies versions and needed to understand better about peerDependencies, because my company is using a monorepo, where it has multiple different libraries and some libraries depends on another libraries and eventually it all boils down to an app. I was just looking for this answer and bumped into your video and the way that you explained such a complex topic is mind blowing 🤯. You even got me thinking about another scenario that we have, when an application may opt-out of certain "sub dependencies" and really inspired me to keep on working on this task today. NPM library creation content are so difficult to find and yours was just **perfect**. tysm!!
I do have one question though. Let's say I have an app that uses a library (created by me) that depends on the styled-components package. The styled-components package has a peerDependency "react-is". Should I add this peerDependency: a) as a *dependency* for my library? b) as a *peerDependency* for my library and as a *dependency* on my app? c) other - please explain
Thanks for the helpful video. I've had to take over a project that hasn't been updated for years and with the "new" npm being more strict and angular's lackluster documentation it's been a right headache.
I am updating my nextjs app and I installed(upgraded) packages with "--force" . It installed the packages, but "npm i" still gives the error. Will this be a problem when deploying on vercel?
The error is just a warning once you have forced the install - just reminds you that there is no official support for the current setup you have and there may be mismatches. When you deploy as long as you are not running npm on the sever and just pushing up the locally built package then should be fine. Cheers Mark
WOW!
I'm currently going through that phase of updating my project's dependencies versions and needed to understand better about peerDependencies, because my company is using a monorepo, where it has multiple different libraries and some libraries depends on another libraries and eventually it all boils down to an app. I was just looking for this answer and bumped into your video and the way that you explained such a complex topic is mind blowing 🤯. You even got me thinking about another scenario that we have, when an application may opt-out of certain "sub dependencies" and really inspired me to keep on working on this task today.
NPM library creation content are so difficult to find and yours was just **perfect**. tysm!!
I do have one question though.
Let's say I have an app that uses a library (created by me) that depends on the styled-components package. The styled-components package has a peerDependency "react-is". Should I add this peerDependency:
a) as a *dependency* for my library?
b) as a *peerDependency* for my library and as a *dependency* on my app?
c) other - please explain
I like your examples which really helped me to understand what peer dependencies really are.
Excellent, glad it was helpful :-) Cheers Mark
Thanks for the helpful video. I've had to take over a project that hasn't been updated for years and with the "new" npm being more strict and angular's lackluster documentation it's been a right headache.
Great to hear! Cheers Mark 🙂
I am updating my nextjs app and I installed(upgraded) packages with "--force" . It installed the packages, but "npm i" still gives the error. Will this be a problem when deploying on vercel?
The error is just a warning once you have forced the install - just reminds you that there is no official support for the current setup you have and there may be mismatches. When you deploy as long as you are not running npm on the sever and just pushing up the locally built package then should be fine. Cheers Mark
what about using package.json overrides in this case ? is not it better than using force or peer deph ?
Thank you! Great examples!
Glad it was helpful! Cheers Mark
Thankyou, It really helped :)
You're welcome!
105
Wasted 18 minutes for nothing