Linux system errors
Exit Code 127
Reviewed for reference consistency: August 11, 2026
shell command or executable binary not found
What 127 Means
The 127 error on the Linux system errors indicates exit code 127 — shell command or executable binary not found. This typically occurs due to requested command not present in system path directories.
Exit code 127 reports a command the shell could not find in any $PATH directory — the name is missing, misspelled, or not installed. It differs from 126, where the file exists but is not executable, and a script whose shebang names a missing interpreter can also produce it.
How to fix 127
General informational guidance, not professional advice. Commands can affect your system or data — back up first and proceed at your own risk. FixerCode is an independent reference, not affiliated with any vendor mentioned.
Confirm the command can be found
Use the shell's command lookup to see whether the name resolves in the current environment.
command -v gitInspect the active PATH
A command may work interactively but fail in cron, CI, or service environments because PATH is shorter there.
printf '%s\n' "$PATH"Use an explicit local path
If the executable is in the current directory, call it with a relative path so the shell does not search PATH.
./script.shCheck the script interpreter line
A file can exist and still return 127 when the interpreter named on its first line is missing from the system — the shebang is a promise the shell cannot honor.
sed -n '1p' ./script.sh
Technical Background
When a shell receives a command name without an explicit path (like 'node' or 'gcc'), it sequentially searches every directory listed in the $PATH environment variable. If none of the directories contain an executable matching that name, the shell returns exit code 127.
Exit code 127 is distinct from exit code 126. Code 126 indicates that the file was found but lacks executable permissions, whereas 127 means the file could not be found at all.
Common Causes
- Requested command not present in system PATH directories
- Typographical error in binary name or script invocation
- Script referencing a missing interpreter or broken shebang path
- Missing dynamic shared library dependencies required to execute the binary
Typical Scenarios
- A CI/CD pipeline step fails when attempting to invoke an uninstalled CLI utility
- A shell script fails with 'command not found' due to a corrupted PATH environment variable
- A Docker container build aborts when a script references a missing binary
What to Know
Exit code 127 confirms that the requested command was not located. Verifying the command spelling, binary installation, and $PATH configuration resolves the execution failure.
Frequently Asked Questions
Common questions about Linux 127 error
The PATH environment variable might be configured differently across different shell sessions, users, or automated environments like cron jobs.
Yes. If you attempt to execute a script that starts with a shebang (e.g., #!/bin/node) and that specific interpreter does not exist on the system, the shell will report command not found.
When a script is saved with Windows line endings (CRLF), the Linux shell interprets the carriage return as part of the interpreter's name (like bash\r). Since no such file exists, it returns a 127.
Build runners wrap each step in a shell, so the wrapper message carries the shell verdict: 127 means the binary named by the step was never found on the PATH inside the runner. The same command can exist on a developer laptop and still be absent from the CI image.
Related Error Codes
Related Errors From Other Categories
Similar error codes documented across different platforms and systems
The registry has no manifest for the exact repository and tag requested.
The image reference string violates the naming rules before any lookup.
A container claims the requested human name, and names must stay unique.
A removal request hit a volume that running or stopped containers still mount.