{"id":18066,"date":"2013-09-06T18:15:25","date_gmt":"2013-09-06T10:15:25","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=18066"},"modified":"2023-04-06T19:17:40","modified_gmt":"2023-04-06T11:17:40","slug":"grunt-command-not-found","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/","title":{"rendered":"Quickly Fix Grunt &#8216;Command Not Found&#8217; Error in Terminal"},"content":{"rendered":"<p>In one of our previous post we have discussed how to <a href=\"https:\/\/www.hongkiat.com\/blog\/jquery-remove-modules\/\">build customized jQuery<\/a>. In the process, we used <a href=\"https:\/\/gruntjs.com\/\" rel=\"nofollow\">Grunt<\/a> to perform the task, for testing, compiling, and compressing the library. However, some of you might encounter an issue where the command <code>grunt<\/code> is not recognized in your system, even when we had run <code>npm install -g grunt-cli<\/code> to install the package.<\/p>\n<p>In this case, you typically will get the following error message in your Terminal.<\/p>\n<pre>\r\n-bash: grunt: command not found\r\n<\/pre>\n<p>The <strong>\u201cCommand Not Found\u201d<\/strong> error occur is due to the Grunt binary not having been added to the shell \u2013 this most likely happened since Grunt 0.4. Here is how to get it fixed.<\/p>\n<p class=\"note\"><strong>Check this:<\/strong> <a href=\"https:\/\/kb.iu.edu\/d\/agvf\" rel=\"nofollow\">In Unix, what is the shell?<\/a><\/p>\n<h2>Step 1<\/h2>\n<p>First, let\u2019s check whether the <strong>.bash_profile<\/strong> exists.<\/p>\n<pre>\r\ntest -e ~\/.bash_profile && echo \"Found\" || echo \"Not Found\"\r\n<\/pre>\n<p>If it exists, it will return <strong>Found<\/strong>, as shown in the following screenshot.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/test-bash-profile.jpg\" width=\"500\" height=\"300\"><\/p>\n<p>The .bash_profile is a shell script that is executed when we start the Terminal. To be able to run the <code>grunt<\/code> command we need to link the path where the Grunt binary is located in this file. In the case where it returns <strong>Not Found<\/strong>, meaning that it doesn\u2019t exist, you need to create it first by running this command line.<\/p>\n<pre>\r\ntouch ~\/.bash_profile\r\n<\/pre>\n<p>Run the test again to ensure.<\/p>\n<h2>Step 2<\/h2>\n<p>Open the .bash_profile in TextEdit using this command line, so that we are able to edit the content easily.<\/p>\n<pre>\r\nopen -a TextEdit ~\/.bash_profile\r\n<\/pre>\n<p>When we are installing <strong>Grunt<\/strong>, we will see the path where the binary is added from the report.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/grunt-path.jpg\" width=\"500\" height=\"300\"><\/p>\n<p>Add the path in .bash_profile, as follows.<\/p>\n<pre>\r\nexport PATH=\/usr\/local\/share\/npm\/lib\/node_modules\/grunt-cli\/bin:$PATH\r\n<\/pre>\n<p>Save it and exit.<\/p>\n<h2>Step 3<\/h2>\n<p>To ensure that our .bash_profile is executed when we open the Terminal, run this command line.<\/p>\n<pre>\r\nsource ~\/.bash_profile\r\n<\/pre>\n<p>Restart your Terminal, run a test whether the <code>grunt<\/code> command is now recognized:<\/p>\n<pre>\r\ngrunt --version\r\n<\/pre>\n<p>If it works, you should now see the following message.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/grunt-version.jpg\" width=\"500\" height=\"300\"><\/p>","protected":false},"excerpt":{"rendered":"<p>In one of our previous post we have discussed how to build customized jQuery. In the process, we used Grunt to perform the task, for testing, compiling, and compressing the library. However, some of you might encounter an issue where the command grunt is not recognized in your system, even when we had run npm&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3397],"tags":[3053,2695],"topic":[4521],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Quickly Fix Grunt &#039;Command Not Found&#039; Error in Terminal - Hongkiat<\/title>\n<meta name=\"description\" content=\"In one of our previous post we have discussed how to build customized jQuery. In the process, we used Grunt to perform the task, for testing, compiling,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quickly Fix Grunt &#039;Command Not Found&#039; Error in Terminal\" \/>\n<meta property=\"og:description\" content=\"In one of our previous post we have discussed how to build customized jQuery. In the process, we used Grunt to perform the task, for testing, compiling,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-06T10:15:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-06T11:17:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/test-bash-profile.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"Quickly Fix Grunt &#8216;Command Not Found&#8217; Error in Terminal\",\"datePublished\":\"2013-09-06T10:15:25+00:00\",\"dateModified\":\"2023-04-06T11:17:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/\"},\"wordCount\":303,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/grunt-command-not-found\\\/test-bash-profile.jpg\",\"keywords\":[\"Command Line\",\"Grunt\"],\"articleSection\":[\"Desktop\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/\",\"name\":\"Quickly Fix Grunt 'Command Not Found' Error in Terminal - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/grunt-command-not-found\\\/test-bash-profile.jpg\",\"datePublished\":\"2013-09-06T10:15:25+00:00\",\"dateModified\":\"2023-04-06T11:17:40+00:00\",\"description\":\"In one of our previous post we have discussed how to build customized jQuery. In the process, we used Grunt to perform the task, for testing, compiling,\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/grunt-command-not-found\\\/test-bash-profile.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/grunt-command-not-found\\\/test-bash-profile.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/grunt-command-not-found\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quickly Fix Grunt &#8216;Command Not Found&#8217; Error in Terminal\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Quickly Fix Grunt 'Command Not Found' Error in Terminal - Hongkiat","description":"In one of our previous post we have discussed how to build customized jQuery. In the process, we used Grunt to perform the task, for testing, compiling,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/","og_locale":"en_US","og_type":"article","og_title":"Quickly Fix Grunt 'Command Not Found' Error in Terminal","og_description":"In one of our previous post we have discussed how to build customized jQuery. In the process, we used Grunt to perform the task, for testing, compiling,","og_url":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2013-09-06T10:15:25+00:00","article_modified_time":"2023-04-06T11:17:40+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/test-bash-profile.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"Quickly Fix Grunt &#8216;Command Not Found&#8217; Error in Terminal","datePublished":"2013-09-06T10:15:25+00:00","dateModified":"2023-04-06T11:17:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/"},"wordCount":303,"commentCount":2,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/test-bash-profile.jpg","keywords":["Command Line","Grunt"],"articleSection":["Desktop"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/","url":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/","name":"Quickly Fix Grunt 'Command Not Found' Error in Terminal - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/test-bash-profile.jpg","datePublished":"2013-09-06T10:15:25+00:00","dateModified":"2023-04-06T11:17:40+00:00","description":"In one of our previous post we have discussed how to build customized jQuery. In the process, we used Grunt to perform the task, for testing, compiling,","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/test-bash-profile.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/grunt-command-not-found\/test-bash-profile.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/grunt-command-not-found\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Quickly Fix Grunt &#8216;Command Not Found&#8217; Error in Terminal"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-4Ho","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/18066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=18066"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/18066\/revisions"}],"predecessor-version":[{"id":65943,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/18066\/revisions\/65943"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=18066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=18066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=18066"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=18066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}