Monogame: mgcb-editor command not found on Mac

Created on 27 Aug 2020  路  3Comments  路  Source: MonoGame/MonoGame

After I executed dotnet tool install --global dotnet-mgcb-editor
I tried to execute mgcb-editor --register as it follows up on the new setting up guide it always throws me message zsh: command not found: mgcb-editor
I want to use VS Code with the new MonoGame but it seems to be the only issue I currently have.

What version of MonoGame does the bug occur on:

  • MonoGame 3.8

What operating system are you using:

  • MacOS

What MonoGame platform are you using:

  • DesktopGL
MGCB Editor MacOS

Most helpful comment

Quick fix: you should be able to run it directly via ~/.dotnet/tools/mgcb-editor, it should work even without having the tools directory in PATH.


Well, perhaps if you read the output after installment.

$ dotnet tool install --global dotnet-mgcb-editor

Tools directory '$HOME/.dotnet/tools' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:

cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:$HOME/.dotnet/tools"
EOF

You can add it to the current session by running the following command:

export PATH="$PATH:$HOME/.dotnet/tools"

You can invoke the tool using the following command: mgcb-editor
Tool 'dotnet-mgcb-editor' (version '3.8.0.1641') was successfully installed.

$ which mgcb-editor

Well of course it will err...

$ mgcb-editor

  • mgcb-editor: command not found

$ export PATH="$PATH:$HOME/.dotnet/tools" && echo $PATH | grep $HOME/.dotnet/tools

You should see it highlighted on the output.

$ which mgcb-editor | grep $HOME/.dotnet/tools/mgcb-editor

Should be highlighted, try it running mgcb-editor now.

(This is on ubuntu, but it shouldn't really be any different for Mac, btw you can use ~ instead of $HOME it is the same thing.)
If it still doesn't work, switch to bash and repeat all of the above (in your home directory):

$ cd $HOME && source .bashrc

This will only work for this single terminal session, if you open up a new terminal and try to run mgcb-editor you will get unknown command all over again.
To make it permanently accessible (even across reboots), see this SO answer (this will shift your terminal/shell to use bash instead of zsh), and also make sure you append export PATH="$PATH:$HOME/.dotnet/tools" at the end of the ~/.bash_profile file (as told by dotnet tool install command).

All 3 comments

Quick fix: you should be able to run it directly via ~/.dotnet/tools/mgcb-editor, it should work even without having the tools directory in PATH.


Well, perhaps if you read the output after installment.

$ dotnet tool install --global dotnet-mgcb-editor

Tools directory '$HOME/.dotnet/tools' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:

cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:$HOME/.dotnet/tools"
EOF

You can add it to the current session by running the following command:

export PATH="$PATH:$HOME/.dotnet/tools"

You can invoke the tool using the following command: mgcb-editor
Tool 'dotnet-mgcb-editor' (version '3.8.0.1641') was successfully installed.

$ which mgcb-editor

Well of course it will err...

$ mgcb-editor

  • mgcb-editor: command not found

$ export PATH="$PATH:$HOME/.dotnet/tools" && echo $PATH | grep $HOME/.dotnet/tools

You should see it highlighted on the output.

$ which mgcb-editor | grep $HOME/.dotnet/tools/mgcb-editor

Should be highlighted, try it running mgcb-editor now.

(This is on ubuntu, but it shouldn't really be any different for Mac, btw you can use ~ instead of $HOME it is the same thing.)
If it still doesn't work, switch to bash and repeat all of the above (in your home directory):

$ cd $HOME && source .bashrc

This will only work for this single terminal session, if you open up a new terminal and try to run mgcb-editor you will get unknown command all over again.
To make it permanently accessible (even across reboots), see this SO answer (this will shift your terminal/shell to use bash instead of zsh), and also make sure you append export PATH="$PATH:$HOME/.dotnet/tools" at the end of the ~/.bash_profile file (as told by dotnet tool install command).

.zprofile is the file on zsh.

We might as well just update the docs to point this out, so I'll keep the issue open.

Slightly confused as these docs were tested extensively on each platform.

Just to clarify, what is the update in the documentation we are expecting? Just the change to the Path statement?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ellesent picture Ellesent  路  5Comments

Grabiobot picture Grabiobot  路  5Comments

SenpaiSharp picture SenpaiSharp  路  3Comments

dazinator picture dazinator  路  5Comments

MichaelDePiazzi picture MichaelDePiazzi  路  4Comments