Wednesday 26 August 2020

[Yarn] I can't get the right dev/peer dependency version installed for one of my monorepo package's dependencies.

If this isn't the right place to ask Yarn-related questions, please let me know.I’m new to Yarn and monorepos in general, but I’m trying to manage a project with 3 packages under the root. In package A, there is a dependency - let’s call it dependency1. dependency1 has a dev dependency of dependency1a (version ^0.7.3) and a peer dependency of dependency1a (version >= 0.6.0). I have hoisting disabled in package A for right now to simplify things.When I run yarn install and run my app, I get an error that basically says dependency1a wasn’t found in module dependency1. And this is correct because dependency1a isn’t present in dependency1’s node modules folder. It looks like dependency1a already exists in the root node modules, but the version is ^3.1.6. I guess a higher version is required elsewhere in the project.I guess my question is, what do I need to do to get dependency1a installed in dependency1’s node modules? Or, how do I ensure that dependency1 has access to the right version of dependency1a? I’d be happy to provide any additional information about the project structure.

Submitted August 26, 2020 at 03:23PM by sadelbrid

No comments:

Post a Comment