browser-use/browser-use · error · RuntimeError

{ancestor} is not a directory.

Error message

{ancestor} is not a directory.

What it means

Error "{ancestor} is not a directory." thrown in browser-use/browser-use.

Source

Thrown at browser_use/skills/install.py:147

		return [TARGET_DIR_BUILDERS[target]() / 'SKILL.md']

	path = custom_path.expanduser()
	if path.name == 'SKILL.md':
		return [path]
	return [path / 'SKILL.md']


def _validate_output_paths(output_paths: list[Path]) -> None:
	for output_path in output_paths:
		if output_path.exists() and output_path.is_dir():
			raise RuntimeError(f'{output_path} is a directory, expected a SKILL.md file path.')
		ancestor = output_path.parent
		while not ancestor.exists():
			if ancestor.parent == ancestor:
				break
			ancestor = ancestor.parent
		if ancestor.exists() and not ancestor.is_dir():
			raise RuntimeError(f'{ancestor} is not a directory.')


def handle(argv: list[str]) -> int:
	parser = _build_parser()
	args = parser.parse_args(argv)

	command = args.command or 'show'

	if command == 'show':
		try:
			text = _load_skill_text_from_browser_harness_cli()
		except RuntimeError as exc:
			print(f'Error: {exc}', file=sys.stderr)
			return 1
		print(text, end='')
		return 0

	if command == 'install':

View on GitHub (pinned to 6c73fced2f)

Solutions

  1. Ensure the output path's parent directory exists and is a directory.

When it happens

Trigger: An ancestor component of the skill output path exists but is a file, not a directory.

Common situations: A file shadows a directory name in the target skills path.


AI-assisted analysis of browser-use/browser-use@6c73fced2f (2026-08-14). Data as JSON: /api/errors/3369be85cba6ed80. Report an issue: GitHub.