TypeScript "error TS5057: Cannot find a tsconfig.json file" in CI
tsc was invoked with -p / --project pointing at a directory or file that does not contain a tsconfig.json. In CI the cause is almost always a wrong working directory or an unbuilt workspace path.
What this error means
tsc exits immediately with TS5057 before compiling anything. The same command works locally because you run it from the package root, but CI runs it from the repo root or a different folder.
error TS5057: Cannot find a tsconfig.json file at the
specified directory: './packages/web'.Common causes
Wrong working directory in CI
The job runs tsc -p packages/web from a directory where that relative path does not resolve, or the package was not checked out into the expected location.
The project path points at a folder, not a file
tsc accepts a directory only if it contains a tsconfig.json. If the config is named differently (tsconfig.build.json) the directory form fails.
How to fix it
Point -p at the exact config file
Pass the full path to the config so there is no ambiguity about which file or directory tsc should read.
tsc -p ./packages/web/tsconfig.json
# or set the working directory first
# working-directory: packages/webSet the job working directory
Run the compile step from the package root so the default tsconfig.json lookup succeeds.
- Add
working-directory: packages/webto the build step. - Confirm the checkout actually contains that path (use
lsto verify in a debug run). - Use
tsc -p tsconfig.jsonfrom that directory.
How to prevent it
- Reference tsconfig by full file path in CI commands.
- Verify the checkout layout with a one-time
ls -ladebug step when adding a new workspace. - Keep config filenames consistent across packages.