我在 flutter 目录中运行 flutter 命令,但它说找不到命令
root/korra:/Desktop/flutter/bin# flutter
bash: flutter: command not found
但是如果我将 flutter 拖放到终端,整个路径将出现在单引号中并运行所有内容
root@Korra:~# '/root/Desktop/flutter/bin/flutter'
Woah! You appear to be trying to run flutter as root.
We strongly recommend running the flutter tool without superuser privileges.
/
📎
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.
Run "flutter help <command>" for more information about a command.
Run "flutter help -v" for verbose help output, including less commonly used
options.
其他文件也会发生这种情况
最佳答案
您需要在命令前添加 ./
来运行当前目录中的命令,因此:./flutter
。
关于linux - 未找到命令,但在拖放时找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58465980/