{"id":2427,"date":"2020-01-10T15:44:49","date_gmt":"2020-01-10T15:44:49","guid":{"rendered":"http:\/\/upmostlymulti.onpressidium.com\/?p=2427"},"modified":"2021-10-28T11:00:25","modified_gmt":"2021-10-28T16:00:25","slug":"template-not-provided-using-create-react-app","status":"publish","type":"post","link":"http:\/\/upmostly.com\/tutorials\/template-not-provided-using-create-react-app","title":{"rendered":"Fix: Template Not Provided Using Create-React-App"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1160\" height=\"600\" src=\"http:\/\/upmostly.com\/wp-content\/uploads\/template-not-provided-using-create-react-app.jpg\" alt=\"How to fix template not provided using create-react-app in react error\" class=\"wp-image-2433\" srcset=\"https:\/\/upmostly.com\/wp-content\/uploads\/template-not-provided-using-create-react-app.jpg 1160w, https:\/\/upmostly.com\/wp-content\/uploads\/template-not-provided-using-create-react-app-300x155.jpg 300w, https:\/\/upmostly.com\/wp-content\/uploads\/template-not-provided-using-create-react-app-768x397.jpg 768w, https:\/\/upmostly.com\/wp-content\/uploads\/template-not-provided-using-create-react-app-1024x530.jpg 1024w\" sizes=\"auto, (max-width: 1160px) 100vw, 1160px\" \/><\/figure>\n\n\n\n<p>I ran in to an unusual error recently when I tried to run create-react-app. I&#8217;d recieve Template Not Provided Using <a href=\"https:\/\/github.com\/facebook\/create-react-app\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Create React App (opens in a new tab)\">Create React App<\/a>. Let&#8217;s explore what this error is and how we can fix it.<\/p>\n\n\n\n<p>I went to create a new React project using <strong>create-react-app<\/strong> recently, and something very strange happened. The process finished, but the project was empty, all bar a package.json file.<\/p>\n\n\n\n<p>I checked the response in my Terminal window, and lo and behold, create-react-app didn&#8217;t complete properly. Instead, I had the following error:<\/p>\n\n\n\n<div class=\"wp-block-cgb-block-codeplus\"><div class=\"upmostly-block better-code-block\"><div class=\"dark\"><div class=\"code-editor-header\">Terminal<\/div><pre class=\"language-bash\"><code class=\"language-bash\"><div>Installing packages. This might take a couple of minutes.\nInstalling react, react-dom, and react-scripts<span class=\"token punctuation\">..<\/span>.\n<span class=\"token punctuation\">..<\/span><span class=\"token punctuation\">..<\/span>. nothing out of the ordinary here <span class=\"token punctuation\">..<\/span><span class=\"token punctuation\">..<\/span>.\n\u2728  Done <span class=\"token keyword\">in<\/span> 27.28s.\n\nA template was not provided. This is likely because you're using an outdated version of create-react-app.\nPlease note that global installs of create-react-app are no longer supported.<\/div><\/code><\/pre><\/div><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">The Fix<\/h2>\n\n\n\n<p>The issue lies in having installed create-react-app globally before with NPM. Therefore, we have to completely uninstall the package from our system.<\/p>\n\n\n\n<p><strong>1) Uninstall Create-React-App Globally<\/strong><\/p>\n\n\n\n<div class=\"wp-block-cgb-block-codeplus\"><div class=\"upmostly-block better-code-block\"><div class=\"dark\"><div class=\"code-editor-header\">Terminal<\/div><pre class=\"language-bash\"><code class=\"language-bash\"><div><span class=\"token function\">npm<\/span> uninstall -g create-react-app<\/div><\/code><\/pre><\/div><\/div><\/div>\n\n\n\n<p>Check that create-react-app has indeed been uninstalled completly by running the following command in your Terminal window:<\/p>\n\n\n\n<div class=\"wp-block-cgb-block-codeplus\"><div class=\"upmostly-block better-code-block\"><div class=\"dark\"><div class=\"code-editor-header\">Terminal<\/div><pre class=\"language-bash\"><code class=\"language-bash\"><div><span class=\"token function\">which<\/span> create-react-app<\/div><\/code><\/pre><\/div><\/div><\/div>\n\n\n\n<p>If this returns with a directory location, such as \/usr\/local\/bin\/create-react-app, then run the following command to delete the directory entirely.<\/p>\n\n\n\n<div class=\"wp-block-cgb-block-codeplus\"><div class=\"upmostly-block better-code-block\"><div class=\"dark\"><div class=\"code-editor-header\">Terminal<\/div><pre class=\"language-bash\"><code class=\"language-bash\"><div><span class=\"token function\">rm<\/span> -rf \/usr\/local\/bin\/create-react-app<\/div><\/code><\/pre><\/div><\/div><\/div>\n\n\n\n<p><strong>2) Run NPX Create-React-App Again<\/strong><\/p>\n\n\n\n<p>Now, give it another try! This time it should work:<\/p>\n\n\n\n<div class=\"wp-block-cgb-block-codeplus\"><div class=\"upmostly-block better-code-block\"><div class=\"dark\"><div class=\"code-editor-header\">Terminal<\/div><pre class=\"language-bash\"><code class=\"language-bash\"><div>npx create-react-app new-project<\/div><\/code><\/pre><\/div><\/div><\/div>\n\n\n\n<p>If this fixed the template not provided using create react app issue for you, fantastic! If not, leave a comment below with a sample of the terminal output and I&#8217;ll reply with a solution.<\/p>\n\n\n\n<p>To learn more about React, why not check out my beginner tutorial on <a rel=\"noreferrer noopener\" aria-label=\"how to create your first app in React (opens in a new tab)\" href=\"http:\/\/upmostly.com\/tutorials\/react-hello-world-your-first-react-app\" target=\"_blank\">how to create your first app in React<\/a>?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ran in to an unusual error recently when I tried to run create-react-app. I&#8217;d recieve Template Not Provided Using Create React App. Let&#8217;s explore what this error is and how we can fix it. I went to create a new React project using create-react-app recently, and something very strange happened. The process finished, but [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":2433,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[33,46,45,4],"class_list":["post-2427","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-beginner-react-tutorials","tag-create-react-app","tag-errors","tag-react"],"acf":[],"_links":{"self":[{"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/posts\/2427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/comments?post=2427"}],"version-history":[{"count":1,"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/posts\/2427\/revisions"}],"predecessor-version":[{"id":2869,"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/posts\/2427\/revisions\/2869"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/media\/2433"}],"wp:attachment":[{"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/media?parent=2427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/categories?post=2427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/upmostly.com\/wp-json\/wp\/v2\/tags?post=2427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}