Flutterでスマホアプリ開発をしたい!
Flutter の公式サイトからSDKをインストールして、パスの設定をしてパスが通っているか確認ができない。
zsh: command not found: flutter
と表示されて、どう対応したら良いのか分からない。

この記事はこんな人におすすめです!
・flutterの開発環境の構築で順調に進んでない方
- zsh: command not found: flutter が表示されたときの対処法
ちなみに、Flutterのスキルを0から効率的に伸ばす方法は、仕事として実務を経験することです。そして、最速で転職・就職・副業するには学習をどんどん進め、ポートフォリオを最優先で完成させましょう!応募できそうなFlutter案件をチェックすると必要なスキルも分かり学習に身が入ります!Flutter案件/求人の探し方はコチラで詳しく解説していますので、ご参考にして下さい。
事象(zsh: command not found: flutter)
開発環境
モデル | MacBook Air 2020 |
CPU・GPU | M1(GPU8コア GPU8コア) |
メモリ | 16GB |
SSD | 512GB |
FlutterのSDKをインストールして、pathを設定後に、flutterとコマンドを打ってみたがzsh:command not found : flutterと表示され確認ができない。
Last login: Tue Aug 9 21:35:40 on console
XXX@tinoMacBook-Air ~ % flutter
zsh: command not found: flutter
原因:設定したpathが間違っていた
設定したpathが正しいか次の方法で確認しましょう
Finderからホームで、隠しファイルを表示させます。
隠しファイルの表示方法は、「Shift + command + .」です。


.zshrc ファイルを右クリックしてテキストエディトを選択して、ファイルを開きます。


ファイルを開くと、設定したpathが書かれてます。
正しいか確認しましょう。
export PATH=PATH:/Users/yakiimo/development/flutter/bin
export PATH=/Users/yakiimo/development/flutter/bin
export PATH="$PATH:/Users/yakiimo/development/flutter/bin"



私は上記のようにpathで複数設定されてて、うまく動作できなかったです。
ターミナルから、echo $PATH でも確認はできます。
echo $PATH で確認
Last login: Tue Aug 9 21:35:40 on console
XXX@tinoMacBook-Air ~ % echo $PATH
PATH=PATH:/Users/yakiimo/development/flutter/bin:
PATH=/Users/yakiimo/development/flutter/bin:
PATH="$PATH:/Users/yakiimo/development/flutter/bin"
対処方法(正しいpathを設定する)
正しいpathのみ残して、間違ったpathは削除してファイルを保存します。
export PATH="$PATH:/Users/yakiimo/development/flutter/bin"
再度、ターミナルで flutterと打ってみましょう!
Last login: Tue Aug 9 21:35:40 on console
XXX@tinoMacBook-Air ~ % flutter
Manage your Flutter app development.
Common commands:
flutter create <output directory>
Create a new Flutter project in the specified directory.
flutter run [options]
Run your Flutter application on an attached device or in an emulator.
Usage: flutter <command> [arguments]
Global options:
-h, --help Print this usage information.
-v, --verbose Noisy logging, including all shell commands
executed.
If used with "--help", shows hidden options. If used
with "flutter doctor", shows additional diagnostic
information. (Use "-vv" to force verbose logging in
those cases.)
-d, --device-id Target device id or name (prefixes allowed).
--version Reports the version of this tool.
--suppress-analytics Suppress analytics reporting when this command runs.
Available commands:
Flutter SDK
bash-completion Output command line shell completion setup scripts.
channel List or switch Flutter channels.
config Configure Flutter settings.
doctor Show information about the installed tooling.
downgrade Downgrade Flutter to the last active version for the current
channel.
precache Populate the Flutter tool's cache of binary artifacts.
upgrade Upgrade your copy of Flutter.
Project
analyze Analyze the project's Dart code.
assemble Assemble and build Flutter resources.
build Build an executable app or install bundle.
clean Delete the build/ and .dart_tool/ directories.
create Create a new Flutter project.
drive Run integration tests for the project on an attached device
or emulator.
format Format one or more Dart files.
gen-l10n Generate localizations for the current project.
pub Commands for managing Flutter packages.
run Run your Flutter app on an attached device.
test Run Flutter unit tests for the current project.
Tools & Devices
attach Attach to a running app.
custom-devices List, reset, add and delete custom devices.
devices List all connected devices.
emulators List, launch and create emulators.
install Install a Flutter app on an attached device.
logs Show log output for running Flutter apps.
screenshot Take a screenshot from a connected device.
symbolize Symbolize a stack trace from an AOT-compiled Flutter app.
Run "flutter help <command>" for more information about a command.
Run "flutter help -v" for verbose help output, including less commonly used
options.
まとめ:pathが設定されているファイルを確認
今回の記事では、flutterの開発環境の構築時にpathを設定する際に
「zsh: command not found: flutter 」が表示されたときの対処法について解説しました。
- pathが設定されているファイルを確認しましょう!



Flutter公式ページでSDKのインストールからPATHの設定まで書かれています。ご参考にどうぞ。英語ですが、何となくわかりますよ!
Flutterエンジニアになるには?
初心者が中級者レベルのFlutterエンジニアなるまでの進め方をまとめました。
Flutterの学習方法を知る


Flutter をスクールで学ぶ


Flutterの副業を探す


おまけ:Flutter入門の完全ガイド


Flutter/Dartの基礎一覧
Flutter/Dartの入門知識として押さえておきたい内容をまとめました。学習のご参考にどうぞ。
- ローカルデータベース(SQLite)
- グラフ①(fl_chart)
- グラフ②(syncfusion_flutter_charts)
- カレンダーから日付取得①(syncfusion_flutter_datepicker)
- カレンダーから日付取得②(month_picker_dialog_2)