windmill-labs/windmill · error

File not found: ${filePath}

Error message

File not found: ${filePath}

What it means

`wmill dependency push <filePath>` uploads a workspace dependencies file. Before reading, it checks `fs.existsSync(filePath)` and throws this error when the file does not exist on the local filesystem, aborting before any network call.

Source

Thrown at cli/src/commands/dependencies/dependencies.ts:20

import { resolveWorkspace } from "../../core/context.ts";
import { GlobalOptions } from "../../types.ts";
import { colors } from "@cliffy/ansi/colors";
import { Command } from "@cliffy/command";
import * as log from "../../core/log.ts";
import * as wmill from "../../../gen/services.gen.ts";
import fs from "node:fs";
import { workspaceDependenciesPathToLanguageAndFilename } from "../../utils/metadata.ts";
import { readTextFileSync } from "../../utils/utils.ts";

async function push(
  opts: GlobalOptions,
  filePath: string,
): Promise<void> {
  const workspace = await resolveWorkspace(opts);
  await requireLogin(opts);

  if (!fs.existsSync(filePath)) {
    throw new Error(`File not found: ${filePath}`);
  }

  const content = readTextFileSync(filePath);

  // Use the existing pushWorkspaceDependencies function
  await pushWorkspaceDependencies(
    workspace.workspaceId,
    filePath,
    null,
    content,
  );
}

const command = new Command()
  .alias("deps")
  .description("workspace dependencies related commands")
  .command("push", "Push workspace dependencies from a local file")
  .arguments("<file_path:string>")

View on GitHub (pinned to e474e8803c)

Solutions

  1. Verify the path: `ls <filePath>` from the same directory you run wmill in.
  2. Run the command from the project root or pass an absolute path.
  3. Check the file name matches a supported format (package.json, requirements.in, composer.json, go.mod, modules.json).

Example fix

// before
await $`wmill dependency push ./deps/reqirements.in`;
// after
await $`wmill dependency push ./deps/requirements.in`;
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'node:fs';
if (!existsSync(filePath)) throw new Error(`dependencies file missing: ${filePath} (cwd: ${process.cwd()})`);

Type guard

null

Try / catch

try { await pushDeps(file) } catch (e) { if (String(e).startsWith('File not found')) console.error(`check path, cwd=${process.cwd()}`); throw e; }

Prevention

When it happens

Trigger: Running `wmill dependency push` with a path that doesn't exist — typo in filename, wrong working directory, file deleted, or passing the directory instead of the file.

Common situations: Running from a different cwd in CI than locally; pushing `requirements.in` but the project uses `requirements.txt`; relative vs absolute path confusion in scripts.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/65c2092cb8e3ee5c. Report an issue: GitHub.