Fix mongosh is not recognised as an internal or external command, operable program or batch file

Поделиться
HTML-код
  • Опубликовано: 24 фев 2024
  • how to fix mongosh is not recognised as an internal or external command, operable program or batch file error in Windows
    How to solve 'mongosh' is not recognized as an internal or external command,operable program or batch file in mongodb shell is shown in this video.
    If you're encountering the error message "mongosh is not recognized as an internal or external command", it means that the MongoDB shell command-line interface (mongosh) is not available in your system's PATH environment variable.
    To resolve this issue, you need to ensure that the MongoDB binaries directory is added to your system's PATH. Here's how you can do it:
    Locate the MongoDB Binaries Directory: Find the directory where MongoDB is installed on your system. This directory contains the mongosh executable.
    Update the PATH Environment Variable:
    On Windows:
    Open the Control Panel.
    Navigate to System and Security - System.
    Click on "Advanced system settings" on the left.
    In the System Properties window, click on the "Environment Variables..." button.
    In the Environment Variables window, find the "Path" variable in the System variables section and select it.
    Click on the "Edit..." button.
    Add the path to the MongoDB binaries directory (the directory containing mongosh) to the list of paths. Separate paths with semicolons (;).
    Click "OK" on all windows to save the changes.
    Restart your command prompt or terminal for the changes to take effect.
    Verify the Installation: After updating the PATH, open a new command prompt or terminal window and try running mongosh again. You should no longer encounter the "not recognized" error.
    Following these steps should enable you to use mongosh from any directory in your command prompt or terminal.
  • НаукаНаука

Комментарии • 2

  • @ДмитрийСавков
    @ДмитрийСавков 13 дней назад +1

    Thank you! For me the path to mongodb isn't necessary - only to mongosh is enough.

    • @mjhacks6443
      @mjhacks6443  13 дней назад

      Thank for writing this comment. You are the first one to give feedback❤🎉. This comment made me 😃