【问题标题】:Trouble installing flutter on macOS High Sierra在 macOS High Sierra 上安装颤振时遇到问题
【发布时间】:2019-02-01 05:24:25
【问题描述】:

我一直在关注this address 的教程,但在我完成并成功运行echo $PATH 后似乎仍然无法运行flutter doctor

我能想到的唯一原因是因为我最初可能需要将我的目录更改为颤振文件夹,而不是用户文件夹,但我怀疑这会产生什么真正的不同。

我已经联系了本教程的作者,他说另一位用户觉得这很有帮助;

I managed to solve it myself after I began looking into 'fish'. Apparently I had to declare the path in "~/.config/fish/config.fish" rather than "~/.bash_profile" and then of course run "source ~/.config/fish/config.fish" rather than "source ~/.bash_profile"

这就是我的终端的样子;

MacBook-Air:~ jake$ cd /users/jake/
MacBook-Air:jake jake$ touch .bash_profile
MacBook-Air:jake jake$ source $HOME/.bash_profile
MacBook-Air:jake jake$ echo $PATH
/flutter/bin:/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jake/.composer/vendor/bin:/Users      /jake/.composer/vendor/bin
MacBook-Air:jake jake$ flutter doctor
-bash: flutter: command not found

我期待这样的事情;

非常感谢,杰克

【问题讨论】:

  • flutter 在你的机器中位于哪里?..(在我的机器中,它在~/Downloads/flutter
  • 我的位于 ~Users/Jake/flutter

标签: macos terminal visual-studio-code dart flutter


【解决方案1】:

快速修复:

  export PATH=$PATH:/Users/Jake/flutter/bin
  flutter doctor

永久修复:

假设您使用的是bash shell,

  • cd $HOME
  • touch .bashrc 如果没有的话
  • .bashrc 文件中添加Quick fix line 1 作为最后一个
  • 打开新标签并检查flutter doctor。它应该工作

如果它不起作用,请让我知道

【讨论】:

  • 你想让我怎么运行这个?你想让我在sudo nano .bash_profile 中运行它吗?另外我不知道如何将其添加到.bashrc/.zshrc/.fishrc,因为我对这个环境很陌生。
  • 不,上面写着= is not a valid identifier/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jake/.composer/vendor/bin:/Users/Jake/flutter/bin': not a valid identifier
  • 你能打开新标签/窗口试试
  • 你能运行这个echo $0并告诉结果
  • 上面写着-bash
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-01-07
  • 2018-12-05
  • 2018-11-15
  • 2018-06-11
  • 2018-01-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多