Comments (5)
A workspace has no parent from its general perspective, so it doesn't provide any peer dependency (until it gets used as a dependency of another package). You need to also list expo/react-native as devDependencies
(I guess expo
already is?).
from berry.
@arcanis Thank you for taking a look at this!
I'm not sure I fully understand your answer though.
I'm not doing anything at the workspace level, it's only within one of the sub-packages. Shouldn't it be enough to specify expo
as peerDependency
without having to also add it as dependency
/devDependency
?
(I'm not calling expo
directly, I'm only adding it to satisfy the constraint from the expo-secure-store
dependency).
from berry.
Workspaces have two perspectives (sets of dependencies):
- As dependencies of another workspace
- As root of the dependency tree (for example when running
yarn run
from within this workspace's folder)
Even if workspaces depending on @baqhub/sdk-expo
declare react-native
in their dependencies, the second perspective is still there: if you run a yarn run
command from packages/lib-sdk-expo
, there will be no "parent package", thus no react-native
. That's why listing a peer dependency often means you need a matching dev dependency (we probably should make this clearer).
from berry.
That makes sense! I appreciate the thorough explanation 🙇♂️
And the solution is quite straightforward as well. Not a bug then!
from berry.
Faced the same issue and could not figure it out for a long time. IMHO yarn run
is not the most common usage of a package. Clearer error message or some references in documentation would be so much help. With "add to peers" approach it's easy to make sure you have only one copy of a package in your project. Duplicating dev dependencies can lead to multiple versions of a package is workspaces environment if not careful with dependencies management.
from berry.
Related Issues (20)
- [Feature] run `yarn install` after `yarn patch-commit -s ..`
- [Bug]: yarn -C ignores package.json packageManager setting.
- [Bug?]: wrong peer dependencies reporting HOT 1
- [Bug?]: yarn npm audit IDs are not stable
- [Feature]: use terminal colors HOT 2
- [Bug?]: yarn with node-linker does not correctly install nested dependencies HOT 2
- [Feature] Alternative to Node.js experimental corepack to manage package manager version HOT 4
- [Bug?]: TimeoutOverflowWarning when running PnP project with mocked `Date.now()`
- [Feature] yarn install --yes HOT 1
- [Bug?]: Prepack script does not run on packages installed from git HOT 1
- [Bug?]: "ENOENT: no such file or directory, link ..." when configured for `nodeLinker: pnpm` and running in Docker with mounted filesystem HOT 3
- [Bug?]: yarn up does not update dependencies
- [Bug?]: `fs.watch` method returns incorrect object.
- [Bug?]: Types are not inferred correctly for dependency if type is from nested dependency
- [Bug?]: Error: EXDEV: cross-device link not permitted
- [Bug?]: Duplicated same-version packages in node_modules but not in yarn.lock HOT 3
- [Feature] Yarn environment variable for ".yarn" folder
- [Feature] Allow install platform environment flag when postinstall scripts are disabled HOT 1
- [Feature] Allow filter out non-warnings on `yarn explain peer-requirements`
- [Feature] Allow filter out non-warnings on yarn explain peer-requirements` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from berry.