gts does not work in a yarn workspaces monorepo
See original GitHub issue$ yarn run clean
yarn run v1.22.4
$ gts clean
Error: /home/niko/WebstormProjects/beach/beach-monorepo/packages/server/tsconfig.json Not Found
at getBase (/home/niko/WebstormProjects/beach/beach-monorepo/node_modules/gts/build/src/util.js:66:15)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ yarn run check
yarn run v1.22.4
$ gts check "src/**/*.ts"
internal/modules/cjs/loader.js:955
throw err;
^
Error: Cannot find module '/home/niko/WebstormProjects/beach/beach-monorepo/packages/server/node_modules/eslint/bin/eslint'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:15)
at Function.Module._load (internal/modules/cjs/loader.js:835:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
In order to make it work you have to nohoist
both gts
and eslint
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
Workspaces - Yarn
Workspaces are a new way to set up your package architecture that's available by default starting from Yarn 1.0. It allows you to...
Read more >Improved mono-repo for Typescript + Cloud Function ...
I've addressed this using yarn workspaces and following a mono-repo pattern that is common when developing node packages.
Read more >react native - Monorepo: Yarn workspaces not working
I am using monorepo created using Yarn Workspaces with Typescript which has a react-native project (mobile folder) and a common folder which ...
Read more >JS Monorepo Blog Part 2 - Carbon Health
It outlines our existing problems and our initial solutions ... We decided to move forward with Yarn Modern Workspaces since we were already ......
Read more >Migrating our Monorepo to Yarn 2 | DoltHub Blog
We wanted React 18 to be more stable before upgrading and webpack 4 was not working with Yarn 2. Once we upgraded React...
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 FreeTop 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
Top GitHub Comments
Experienced the same issue. The
nohoist
option is a quick fix, but giveneslint
package size, it hurts. Espeacially since we want to use it in ALL WORKSPACES. It would be great ifgts
could use the ‘next’ available eslint binary, althought I can’t anticipate the potential downsides of this…I actually ended up doing this since npm workspaces doesn’t have nohoist as an option, so I was stuck. I just removed the
gts
-specificnpm
scripts frompackage.json
and kept the configs since those were working without issue. I have a top-levellint
that is working withgts
so I just make sure my CI/CD pipeline uses that.