1

I'm trying to install create-react-app in my project, but a package.json without a start script is generated, and I get an error "A template was not provided. This is likely because you're using an outdated version of create-react-app. Please note that global installs of create-react-app are no longer supported." As recommended in other questions regarding this issue, here's what I've already tried: npm uninstall -g create-react-app, which create-react-app then rm -rf [the path that was listed] (now when I enter which create-react-appit says which: no create-react-app in ....., and restarted my computer.

I don't know what else to try. Any help appreciated.

Here is my full error message/what I get when trying to run create-react-app:

$ npx create-react-app client

Creating a new React app in C:\Users\deja\Desktop\repos\devconnect\client.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 154 new dependencies.
info Direct dependencies
├─ [email protected]
├─ [email protected]
└─ [email protected]
info All dependencies
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @babel/[email protected]
├─ @csstools/[email protected]
├─ @svgr/[email protected]
├─ @svgr/[email protected]
├─ @svgr/[email protected]
├─ @svgr/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
├─ @typescript-eslint/[email protected]
├─ @typescript-eslint/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 86.09s.

A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.

6 Answers 6

3

So the best thing to do is to remove create-react-app globally using npm uninstall create-react-app -g or yarn global remove create-react-app because that is likely the reason you're seeing this error message:

This is likely because you're using an outdated version of create-react-app. Please note that global installs of create-react-app are no longer supported.

Once you've removed it, please note you don't need to install create-react-app globally to initialize a new project, its recommended you use the npx package runner tool that comes with at least node 5.2 and above. So npx will basically allow you to run a package without installing it, so on your case create-react-app.

So to create a new project, just type in : npx create-react-app myapp and that will initialize your react app.

Sign up to request clarification or add additional context in comments.

4 Comments

As I mentioned in my question, I already tried npm uninstall create-react-app -g and that didn't resolve the error. I am using npx to run create-react-app as well.
see this answer similar to your question stackoverflow.com/a/59189242/7744772 . If you are using yarn also make sure you do yarn global remove create-react-app
yarn global remove create-react-app solved the problem, thanks!
still i am getting the same error
2

I think @Cozy is right. I got the same issue. But I can't uninstall my create-react-app command by running

npm uninstall create-react-app -g

What I did is run this command to remove create-react-app

which create-react-app | xargs rm

And then use npx to create a new project

npx create-react-app new-app

Hope it helps :)

Comments

0

the reason why this happened is because you ran npm update -g create-react-app after restarting your computer. Uninstall again then create the application again using npx create-react-app name-of-my-app

3 Comments

I only tried npm update -g create-react-app because I was getting the same error after trying npm uninstall -g create-react-app, which create-react-app then rm -rf [the path that was listed] and restarting. I just tried to do the global uninstall again and I'm still getting the same error.
In this case if i were you i would just reinstall node.js
Reinstalling node with the .msi Windows file didn't work. This is what solved the problem: yarn global remove create-react-app
0

I resolved this issue just by following two steps:

Go to the terminal type the following command line

  1. rm -rf /usr/local/bin/create-react-app.

This will remove create-react-app manually.

Now start creating the new app

  1. npx create-react-app my-app

Comments

0

If you are familiar with the old create-react-app, try this.

First, open cmd and type this:
npm uninstall -g create-react-app
Create a folder env in C: drive. Then, create a bin folder inside it.
Now add a file called create-react-app.bat.
Edit it with notepad and copy and paste this inside it.

npm init react-app

Save it.
Now, right click on This PC or My Computer and click Properties.
Now click Advanced System Settings.
Click on Environment Variables.
In System Variables, Find Path.
Now Click Edit.
After the new Dialog Box appears, Click add.
Now Paste this:
C:\env\bin
Now create-react-app should work.

Comments

0

I would uninstall create-react-app globally by this command:

npm uninstall -g create-react-app

npm install create-react-app@latest

npx create-react-app my-app

npx create-react-app my-app --template typescript

OR

Delete delete my users root node_module

npx --ignore-existing create-react-app

LAST, I found the folder in /usr/local/bin and I deleted the create-react-app file, and it worked.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.