How to make binary available to all workspaces? #6217
Unanswered
xaviergmail
asked this question in
Q&A
Replies: 1 comment
-
As the documentation you linked to says; you'll have to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a yarn workspace which specifes
I then have a
deploy
script insample-workspace/package.json
:Running
yarn deploy
insidesample-workspace/
doesn't work.I can run
yarn exec serverless
from the root of my repo. However, if Icd
intosample-workspace
and try to runyarn exec serverless
, it can't find the serverless executable installed in the root of the repo either. I assumed this would work.I have already read How to share scripts between workspaces? and none of those solutions are appealing to me.
We have several workspaces and we used to define the serverless dependency in each workspace's devDependencies. I just wanted to hoist that to the root workspace to make it easier to maintain. I'm not interested in having a script to maintain each package.json.
Things I've tried that didn't work:
"serverless": "*"
as a peerDependency in child workspacesThings I've already tried that work:
npm i -g serverless
works but my team doesn't like that even though serverless uses the locally installed serverless just finenpx serverless
- this is a tad bit slowerAt this point, we're basically only using yarn as a task runner (don't get me started 😂) and my only goal is to avoid having to specify serverless versions in each subproject. Is there another way to make the top-level-only dependency work with child workspace scripts and/or
yarn exec
without cluttering scripts withnpx
?Beta Was this translation helpful? Give feedback.
All reactions