flutter - root 无法找到 flutter 命令

标签 flutter ubuntu root

当我在 ubuntu 上运行 flutter 医生命令或其他 flutter 命令时,它工作正常..
但是当我切换到root用户时

sudo su
然后我跑
flutter doctor
然后它抛出一个错误
Command 'flutter' not found, but can be installed with:
snap install flutter
我不知道为什么会发生这种情况,有人可以帮助我找到实际问题,提前谢谢..

最佳答案

正如@Chance 帮助我在根 bashrc 文件中添加 flutter 路径
我在/etc/bash.bashrc 文件中添加了 flutter 路径,现在它也在 root 用户中工作.. 再次感谢@Chance

关于flutter - root 无法找到 flutter 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67179688/

相关文章:

firebase - 如何在flutter中检查数据是否已成功写入Firebase

firebase - Flutter中Firestore的数据源可以手动设置为只来自Cache吗?

database - 嵌套 FutureBuilder 与嵌套调用以从数据库延迟加载

python - `pip install pandas` 给出 UnicodeDecodeError : 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)

python - 项目模块导入 - Python2.7 [初学者]

linux - 在 Linux 中,如何在 perl 中将用户更改为 root 并继续运行此脚本?如何在 perl 中导出代理?

flutter - 通过多个小部件从模态传递数据

html - 我尝试从 VS Code 运行 HTML 文件,但收到错误 : "Your file couldn’ t be accessed, 它可能已被移动、编辑或删除。”

java - 将数据库复制到 Android 设备中的/数据

dns - 接受的 DNS 根服务器查询