1

I’m using Turborepo with PNPM workspaces, and I have a shared TypeScript config package located at:

packages/typescript-config/
  backends.json
  package.json

Inside apps/http-server/tsconfig.json I extend it like this:

{
  "extends": "@repo/typescript-config/backends.json"
}

However, TypeScript keeps throwing this error:

File '@repo/typescript-config/backends.json' not found.

When I check node_modules/@repo, I only see:

eslint-config -> ../../packages/eslint-config

but @repo/typescript-config is missing, even though the package exists in packages/typescript-config.

Why is PNPM not linking this workspace package, and how do I fix it so that other developers don’t face this problem?

New contributor
Saurabh kumar Sahu is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1

0

In PNPM workspaces, a package is only symlinked into node_modules if at least one workspace project depends on it.

Your package @repo/typescript-config exists in packages/, but no app explicitly lists it as a dependency — so PNPM simply doesn’t link it.

Fix

Add the shared TypeScript config package as a dependency inside the consuming app:

apps/http-server/package.json
{
  "devDependencies": {
    "typescript": "latest",
    "@repo/typescript-config": "workspace:*"
  }
}

Then reinstall workspace dependencies:

pnpm -w install

Now PNPM will create:

node_modules/@repo/typescript-config -> ../../packages/typescript-config

And TypeScript successfully resolves:

"extends": "@repo/typescript-config/backends.json"
New contributor
Saurabh kumar Sahu is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.