StackShelf
Bashエラー エラー解決

Script exited with status 127: Command not found の原因と解決法

Script exited with status 127: Command not found の原因と具体的な解決手順をまとめました。

1分で読める
bashBashエラーScript exited with status 127exit code127Script exited with status 127: Command n

エラーメッセージ(全文)

Script exited with status 127: Command not found

このエラーとは

Script exited with status 127: Command not found は Bash 開発でよく遭遇するエラーです。

想定環境: Windows / macOS / Linux

よく出る状況: CI / cron / スクリプト終了

よくある原因

  • コマンド失敗
  • シグナル終了
  • OOM Killer

解決方法

方法1: set -euxo pipefail

失敗箇所を特定.

set -euxo pipefail
# スクリプト本体

それでも直らないとき

バージョン情報(Bash のバージョン、OS、実行コマンド)を添えて、エラーメッセージ全文と直前に変更した点を確認してください。ログの数行上にも原因の手がかりが残っていることが多いです。

まとめ

「Script exited with status 127: Command not found」は コマンド失敗 が原因のことが多いです。上記の手順で切り分けてください。

次にやること

同じ Bash カテゴリの関連エラーもあわせて確認してください。

よくある質問

Script exited with status 127: Command not found とは何ですか?

Script exited with status 127: Command not found は Bash 実行時に表示されるエラーです。コマンド失敗

Script exited with status 127: Command not found の原因は?

コマンド失敗。シグナル終了。OOM Killer。

Script exited with status 127: Command not found の直し方は?

set -euxo pipefail:失敗箇所を特定.

Bash で Script exited with status 127 が出るのはなぜ?

CI / cron / スクリプト終了

Script exited with status 127: Command not found を防ぐには?

次に読むべき記事

同カテゴリ「Bashエラー」の記事

学習ルート

体系的に学びたい方はこちらから。

エラー・トラブル集で続きを探す →

あわせて読みたい