{"id":3538,"date":"2024-03-06T11:32:23","date_gmt":"2024-03-06T11:32:23","guid":{"rendered":"https:\/\/www.skillvertex.com\/blog\/?p=3538"},"modified":"2024-03-06T11:32:23","modified_gmt":"2024-03-06T11:32:23","slug":"mongodb-node-js-module-mongo-is-not-recognised-as-an-internal-or-external-command","status":"publish","type":"post","link":"https:\/\/www.skillvertex.com\/blog\/mongodb-node-js-module-mongo-is-not-recognised-as-an-internal-or-external-command\/","title":{"rendered":"MongoDB Node.js Module &#8216;Mongo&#8217; Is Not Recognised As An Internal Or External Command"},"content":{"rendered":"\n<p>The error message you&#8217;re seeing indicates that the &#8216;mongo&#8217; command is not recognized by your command-line interface (CLI). This typically happens when the MongoDB executable is not in the system&#8217;s PATH (the list of directories where the system looks for executable files).<\/p>\n\n\n\n<p>Here are a few steps you can take to resolve this issue:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Check MongoDB Installation:<\/strong><br>Ensure that MongoDB is installed on your system. You should have a &#8216;bin&#8217; directory within the MongoDB installation directory, and the &#8216;mongo&#8217; executable should be present in that directory.<\/li>\n\n\n\n<li><strong>Add MongoDB Bin Directory to PATH:<\/strong><br>Add the &#8216;bin&#8217; directory of your MongoDB installation to your system&#8217;s PATH. The exact steps for this depend on your operating system:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>On Windows:<\/strong> set PATH=%PATH%;C:\\path\\to\\mongodb\\bin Replace &#8220;C:\\path\\to\\mongodb&#8221; with the actual path to your MongoDB installation.<\/li>\n\n\n\n<li><strong>On Linux\/macOS:<\/strong><br>bash export PATH=$PATH:\/path\/to\/mongodb\/bin<br>You can add this line to your shell profile file (e.g., ~\/.bashrc, ~\/.bash_profile, or ~\/.zshrc) to make the change permanent.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Restart Your Terminal\/Command Prompt:<\/strong><br>After modifying the PATH, close and reopen your terminal or command prompt. This step is necessary for the changes to take effect.<\/li>\n\n\n\n<li><strong>Verify MongoDB Installation:<\/strong><br>To check if MongoDB is now recognized, you can run:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   mongo --version<\/code><\/pre>\n\n\n\n<p>This should display the version of MongoDB, confirming that the &#8216;mongo&#8217; command is now recognized.<\/p>\n\n\n\n<p>If you&#8217;re still encountering issues, double-check your MongoDB installation, and ensure that the &#8216;bin&#8217; directory containing the &#8216;mongo&#8217; executable is accessible in your system&#8217;s PATH.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The error message you&#8217;re seeing indicates that the &#8216;mongo&#8217; command is not recognized by your command-line interface (CLI). This typically happens when the MongoDB executable is not in the system&#8217;s PATH (the list of directories where the system looks for executable files). Here are a few steps you can take to resolve this issue: This &#8230; <a title=\"MongoDB Node.js Module &#8216;Mongo&#8217; Is Not Recognised As An Internal Or External Command\" class=\"read-more\" href=\"https:\/\/www.skillvertex.com\/blog\/mongodb-node-js-module-mongo-is-not-recognised-as-an-internal-or-external-command\/\" aria-label=\"More on MongoDB Node.js Module &#8216;Mongo&#8217; Is Not Recognised As An Internal Or External Command\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":3539,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[224],"tags":[567],"class_list":["post-3538","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-question-answer","tag-mongodb-node-js-module-mongo-is-not-recognised-as-an-internal-or-external-command","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"_links":{"self":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/3538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/comments?post=3538"}],"version-history":[{"count":1,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/3538\/revisions"}],"predecessor-version":[{"id":3540,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/3538\/revisions\/3540"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/media\/3539"}],"wp:attachment":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/media?parent=3538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/categories?post=3538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/tags?post=3538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}