Best practices for dependency management in a monorepo using npm workspaces and Nx [closed]

I’m working with a monorepo in JavaScript/TypeScript that uses npm workspaces and Nx. The setup includes:

  • 2 frontend apps

  • 2 backend apps

  • Several shared utility packages

I’m trying to establish a clean and maintainable dependency management strategy, but there seem to be conflicting recommendations:

  • Some suggest putting all dependencies in the root package.json

  • Others recommend including only shared dependencies (used by 2+ apps) at the root

  • Some prefer putting all dev dependencies at the root

  • while others recommend scoping everything (including devDeps) to each app’s package.json

I’d love to hear from folks who’ve tried these different approaches. Specifically:

  • What are the pros and cons you’ve experienced with each strategy?

  • How does the choice affect maintenance, especially as the number of apps grows?

  • Any impact on CI build performance or caching when dependencies are hoisted vs scoped locally?

  • Would it make sense to put tools like react, vite, or even framework-specific dev dependencies at the root?

For context, I’ve currently only placed common tools like typescript, eslint, and the testing suite in the root package.json.

Thanks in advance for your insights!