You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac系统下Beego安装失败求助:执行bee version提示未知命令

Why bee version Returns "Unknown command 'bee'" After Installing Beego?

Hey there! Let's break down what's going on here and fix that error.

First, looking at your go env output, I can see your GOBIN is set to /Users/achu/Development/go/bin. This is where Go installs executable binaries from go get commands. The problem is almost certainly that this directory isn't added to your system's PATH—so your terminal doesn't know where to find the bee tool even if it's installed.

Let's troubleshoot step by step:

Step 1: Check if bee was actually installed

First, verify if the bee binary exists in your GOBIN directory. Run this command:

ls /Users/achu/Development/go/bin
  • If you see bee listed here, skip to Step 2 (fixing your PATH).
  • If bee isn't present, that means the go get command didn't successfully install it. Re-run the install command with the -u flag to update and install properly:
    go get -u github.com/beego/bee/v2
    
    (Note: The official Beego tooling has moved to the bee/v2 package for newer versions; if you're targeting an older Beego version, you might need github.com/astaxie/beego/bee instead.)

Step 2: Add GOBIN to your system PATH

Since your terminal can't find the bee binary, we need to tell it where to look. The process depends on which shell you're using (most macOS users use zsh now, but bash is still common):

For Zsh (default on newer macOS):

  1. Open your zsh config file in a text editor:
    nano ~/.zshrc
    
  2. Add this line at the end of the file:
    export PATH=$PATH:/Users/achu/Development/go/bin
    
  3. Save the file (press Ctrl+O, then Enter), exit nano (Ctrl+X), then reload the config to apply changes:
    source ~/.zshrc
    

For Bash:

  1. Open your bash profile:
    nano ~/.bash_profile
    
  2. Add the same PATH line as above:
    export PATH=$PATH:/Users/achu/Development/go/bin
    
  3. Save, exit, and reload:
    source ~/.bash_profile
    

Step 3: Test it out

Now run bee version again—it should recognize the command and show you the version info!

The core issue here is that Go installs tools to your GOBIN directory, but your system doesn't automatically check that location for executable commands unless you explicitly add it to PATH. This is a common gotcha for new Go developers, so you're not alone!

内容的提问来源于stack exchange,提问作者Karthik

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 06:55:36