How does turborepo handle node_modules packages?

Hello, I want to add a new next app to my turborepo monorepo. If I am installing a new package in one of those apps, would I install it in the root directory of the turborepo or within that specific app. Additionally if I am using ct3a, do I need to move the dependencies from package.json into the one at the root directory? Thanks!
Solution:
if Im not mistaken (because I dont use prettier), you can have a root file for prettier and specialize/extend it on each project for their necessities. I believe there are examples online on how to better setup this.
Jump to solution
4 Replies
Rafael Corrêa
Rafael Corrêa14mo ago
From my experience, turborepo installs dependencies on the root. You can test that and see that it allows you to call a package that is being required only in another context. Also, avoid moving packages to the root unsless they are required in global context (not because they are present in multiple places), root package.json in monorepos are usually reserved for linters, precommit hooks (dont kill me Theo), and other things that affect everything as a whole.
Liam
Liam14mo ago
Got it, I installed them in the app and everything is going well. That would mean though things like prettier and the prettier tailwind plugin belong in the root though right? Thanks!
Solution
Rafael Corrêa
Rafael Corrêa13mo ago
if Im not mistaken (because I dont use prettier), you can have a root file for prettier and specialize/extend it on each project for their necessities. I believe there are examples online on how to better setup this.
Liam
Liam13mo ago
Awesome, thanks!
Want results from more Discord servers?
Add your server
More Posts
Is there a way to import a type from a Prisma Model on ClientI know that we have inferRouterInputs and inferRouterOutputs, but I dont feel that is what I need. TThe "experimental-edge" flag in nextjs allows me to deploy websocket in vercel?I know that websocket cannot be used in vercel because it is serverless. However, I understand that How do I add "connect social platform" to my website? (not social login)I'm not sure how to describe this feature. It's basically this from Twitch https://www.twitch.tv/setShould I share packages on Turborepo?I have 2 clients on my app, and I notice they literally have almost all the same dependencies. What how come when i start a new typescript project, eslint breaks?Hey yall! Im trying to get eslint setup and working with typescript in just a regular node projectPrisma types from t3 turborepo db packageI am working on a project using the t3-turbo monorepo template. When using the packages/db package iHow do I use ISR with t3 app.I'm trying to figure out how to do my trpc queries in getStatic props. I can't seem to use useQuery(Next-Auth Session in Server FunctionTrying out the new app directory with an example project and ran into issues with accessing the userFormik, React-Datepicker errorI am getting `TypeError: Cannot read properties of undefined (reading 'type')` when I try to pick "SyntaxError: Cannot use import statement outside a module" when attempting to build a turborepo appI have a turbo repo that has a websocket app. I have a package for my redis client so it can be used