Mongosh ─╯ [1] 13127 killed mongosh. mongo ─╯ zsh: command not found: mongo

I have mongo correctly installed but and the services are up and running but I cannot get into the mongo shell and the mongo command is not found

My configuration file and installation process are here:-

The legacy mongo shell no longer ships with MongoDB. The new shell is mongosh, which from your screenshot I see you tried to use so I assume you have it installed.
Anything you would have done with mongo, now you should be able to do with mongosh.

3 Likes

@Massimiliano_Marcon Hi!
but the mongosh command isn’t working as well. What can I do to solve this issue?

Thank You for your attention to my problem!
Regards.

part of your installation seems broken and your OS does not let you run mongosh. try uninstalling then reinstalling it.

another possible reason would be the cpu architecture difference of your mac and the installation, namely being x64 versus arm64. so check which should you install.

1 Like

@Yilmaz_Durmaz
I have a Mac M1 that is arm64 based architecture but regardless of that i have used “Homebrew” to install MongoDB Community and It automatically installs the version best suited for the mac.
Plus when i manaully tried to do it I installed MongoDB , arm64 based package but it did not work doing that as well.

But ill try uninstalling then reinstalling it.

@Yilmaz_Durmaz I reinstalled it but I’m still getting the same issue.

Since the process is killed after t starts, I thought it would be broken, but instead, it might be a security setting preventing it to run.

check the “note” part few lines below this section of the installation guide: https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/#connect-and-use-mongodb

I just tried on my M1 following the instructions here: https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/. mongosh is installed and works well.

Can you clarify what it means that mongosh is not working? It doesn’t start?

1 Like

she (he?) supplied only a screenshot, yet apparently mongosh starts but is “killed” by the OS before it actually runs (even printing the version) for some reason. Does anything come to your mind?

Not really. It’s worth checking in $HOME/.mongodb/mongosh if there are any log files.

There were two main reasons why I was getting this error.

1st there was a typo in the export path of brew in .zshrc file. Due to which I could not run even some node commands like nodemon.

2nd I had to download Mongosh separately.

Now everything works well.

2 Likes

@Yilmaz_Durmaz @Massimiliano_Marcon Thank you so much for your valuable time on my problem.

Regards!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.