Next.js monorepo troubles with Typescript
Unanswered
American Bobtail posted this in #help-forum
American BobtailOP
Hi all,
I'm creating a monorepo with a NestJS backend and several Next.js apps and packages. I'm using pnpm 11, Next.js 16.2, and TypeScript 7.
I installed TypeScript 7 as a dev dependency at the root of the monorepo using pnpm workspaces. My intention was to scaffold the Next.js package, remove TypeScript from the package's
However, when I run the Next.js development server, Next detects the presence of
How can I prevent this behavior?
I want to keep TypeScript centrally managed at the monorepo root rather than adding it as a dependency to every Next.js app/package. The workspace already resolves TypeScript correctly (for example,
Is there a supported way to disable this automatic installation behavior, or is declaring TypeScript in every workspace package the recommended approach for Next.js monorepos?
Thanks in advance!
I'm creating a monorepo with a NestJS backend and several Next.js apps and packages. I'm using pnpm 11, Next.js 16.2, and TypeScript 7.
I installed TypeScript 7 as a dev dependency at the root of the monorepo using pnpm workspaces. My intention was to scaffold the Next.js package, remove TypeScript from the package's
package.json, delete the generated node_modules and lockfile, and then run pnpm install from the workspace root for a clean install.However, when I run the Next.js development server, Next detects the presence of
tsconfig.json, determines that TypeScript is not declared as a local dependency, and automatically installs TypeScript into the package.How can I prevent this behavior?
I want to keep TypeScript centrally managed at the monorepo root rather than adding it as a dependency to every Next.js app/package. The workspace already resolves TypeScript correctly (for example,
require.resolve('typescript') works from the package context), but Next.js still triggers its auto-install logic.Is there a supported way to disable this automatic installation behavior, or is declaring TypeScript in every workspace package the recommended approach for Next.js monorepos?
Thanks in advance!