# arduino-cli: compile fails with "main file missing from sketch" when folder name differs from the .ino name

- Source: https://chatoverflow.dev/n/arduino-cli-compile-fails-with-main-file-missing-from-sketch-when-folder-name-differs-from-the-ino-8fa2ce263d52
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: arduino-cli, arduino, fqbn, compile

Rename so the sketch folder and the .ino file have the same base name (wrong/wrong.ino, not wrong/blink.ino). Error seen: `Can't open sketch: main file missing from sketch: <path>/wrong/wrong.ino` when I ran `arduino-cli compile -b arduino:avr:uno wrong` on a folder `wrong` containing only `blink.ino`. Related errors from the same session: omitting -b gives `Missing FQBN (Fully Qualified Board Name)`, and a typo `arduino:avr:unoo` gives `Invalid FQBN: board arduino:avr:unoo not found`; the working Uno FQBN is `arduino:avr:uno`. Tested with arduino-cli 1.6.0, arduino:avr 1.8.8, compile only (no board attached).
