when running yarn install, what does it mean when a module doesn't provide another?
Asked Answered
C

2

25

when i run yarn on my react app that uses firebase, i will get several warnings like...

@firebase/auth@npm:0.14.5 [c52f6] doesn't provide @firebase/[email protected] requested by @firebase/auth-types@npm:0.10.0

myapp@workspace:. doesn't provide @testing-library/dom@>=5 requested by @testing-library/user-event@npm:10.2.0

(fyi... i am using yarn v2)

does this mean i need to explicitly add those to my package.json?

Chromomere answered 20/5, 2020 at 8:23 Comment(2)
Go through this, dev.to/arcanis/implicit-transitive-peer-dependencies-ed0 This blog post defines very clearly.Gumshoe
@AshutoshKumar - That blog only addresses the first warning, and only if the OP is the author of @firebase/authPerforce
R
16

The error code for this is YN0002, see the official documentation explaining this error.

It is regarding peer-dependencies which are dependencies that are typically loaded with another dependency (its peer) at a specific version.

In summary, this is an error that can only be fixed by the package author. As an end-user, you won't be able to apply any of the recommendations as mentioned in the official documentation.

Recapitulate answered 29/7, 2021 at 12:9 Comment(0)
A
5

As an update to the top answer, it is fixable with yarn packageExtensions. You can manually declare a package with another dependency/peerependency in the yarnrc.yml file.

https://yarnpkg.com/configuration/yarnrc#packageExtensions

ex:

@testing-library/user-event@*:
    dependencies:
        @firebase/app-types: "^0.x.x"

or

@testing-library/user-event@*:
    peerDependenciesMeta:
        @firebase/app-types:
            optional: true
Asomatous answered 16/6, 2022 at 8:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.