已将Macbook升级至Ventura – 现在出现’command not found: Flutter’。

huangapple go评论101阅读模式
英文:

Updated Macbook to Ventura - now getting 'command not found: Flutter'

问题

output of echo $PATH:

/Users/me/bin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/flutter/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

What the top of my .zshrc file looks like:

# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

Any help and info is greatly appreciated

P.S dart and python also cannot be found. But they're not in my path so guess that makes sense

英文:

Oddly enough I'm able to run my flutter applications, but I'd like to upgrade. However since I've updated to MacOS Ventura Flutter can't be found anymore...

output of echo $PATH:

/Users/me/bin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/flutter/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

What the top of my .zshrc file looks like:

# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

Any help and info is greatly appreciated

>P.S dart and python also cannot be found. But they're not in my path so guess that makes sense

答案1

得分: 0

如果你通常通过输入以下命令来启动Flutter:

Flutter

你可以在 /usr/opt 中搜索一个可执行的文件(即一个程序),文件名为 Flutter,可以这样做:

find /usr /opt -name "Flutter" -type f -perm +111

然后,如果找到了,将包含 Flutter 的目录名称添加到你的 PATH 中。所以如果找到了:

/opt/homebrew/bin/Flutter

你可以执行以下命令:

export PATH=$PATH:/opt/homebrew/bin

如果在 /usr/opt 中找不到它,你需要在整个文件系统中进行更耗时的搜索,并且抑制错误消息:

find / -name "Flutter" -type f -perm +111 2> /dev/null
英文:

If you normally start flutter by typing:

Flutter

you can search in /usr and /opt for a file (rather than a directory) that is executable (i.e. a program) and called Flutter like this:

find /usr /opt -name "Flutter" -type f -perm +111

Then, if/when you find it, add the name of the directory that contains Flutter to your PATH. So if it finds:

/opt/homebrew/bin/Flutter

you would do:

export PATH=$PATH:/opt/homebrew/bin

If you don't find it in /usr or /opt, you will need to perform a more time-consuming search across the whole filesystem and also suppress error messages:

find / -name "Flutter" -type f -perm +111 2> /dev/null

huangapple
  • 本文由 发表于 2023年2月18日 21:03:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/75493512.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定