This isn't quite true. Npm is smart enough to resolve common versions of packages so if they both depended on the same major version of react, it would be fine.
This is probably a bad example, though, as 99.9% of the time react would be a peer dependency instead (which completely alleviates this problem and gives the version responsibility to the consumer)
This isn't quite true. Npm is smart enough to resolve common versions of packages so if they both depended on the same major version of react, it would be fine.
This is probably a bad example, though, as 99.9% of the time react would be a peer dependency instead (which completely alleviates this problem and gives the version responsibility to the consumer)
I have to mention again, that this is a specific use case when you use
npm link
Unfortunately that's true. NPM is just a package manager, install/uninstall dependencies. Node is the one who resolves dependencies.
nodejs.org/api/modules.html#module...
Smart enough should be the bundler to know what exactly to load.
github.com/iamandrewluca/example-n...
I mentioned it in another comment but in my experience, npmjs.com/package/yalc solves all of these kind of issues. It's so useful