Breaks dependencies in mono repos when using yarn
See original GitHub issueIf I install my dependencies with yarn install --frozen-lockfile --production
and ts-node is only part of my dev dependencies,
ts-patch will run npm, not yarn, and destroy my mono repo node_modules.
Desired fix:
- please use
yarnwhen there’s ayarn.lock - alternatively; add an option to skip
npmusage, and either throw a warning or an error when mismatch dependencies.
My workaround currently:
- moved
ts-nodetodependencies
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to Easily Manage Dependencies in a JS Monorepo
Phantom dependencies break the code when you publish. With Pnpm or yarn workspace every package in the monorepo has its own package.json and ......
Read more >Workspaces in Yarn | Yarn Blog
Monorepos · Lerna · Introducing Yarn Workspaces · Setting up Workspaces · Managing dependencies of Workspaces · Integrating with Lerna · What is...
Read more >Working with multiple monorepos #5426 - yarnpkg/yarn - GitHub
I have 2 mono repos with yarn workspaces: A and B. B packages are using packages from A. I want to be able...
Read more >A guide through The Wild Wild West of setting up a mono repo ...
Yarn Workspaces is a feature that allows users to install dependencies from multiple package.json files in subfolders of a single root package.json file,...
Read more >TypeScript Monorepos with Yarn - Semaphore CI
Now, create a building block and uncheck the Dependencies section. Removing block dependencies in the pipeline makes blocks run in parallel.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Awesome! Thanks for the explanation 😄
I considered it, but
ts-nodeis not actually required to usets-patch. The majority of people won’t need it to be installed, as they are using transformer packages, which are already compiled to js.ts-nodeis only really necessary if you want to try to directly use a.tstransformer. In that case, it should be assumed thatts-nodeis necessary, but we also throw a pretty clear error message, so I think we’re covered.https://github.com/nonara/ts-patch/blob/541df51364cf277d003e3ab892ee8a3a2ec5a30f/src/patch/lib/plugin.ts#L163-L169
That said, in v2, it will come pre-packaged, so there won’t be any error.