"megahit: command not found" after correct installation with miniconda
type conda info --envs.  Look at your list of environments.  Say it's base that has megahit in it, do conda activate base, then just do megahit.