Problem with installing React

Why am i getting this when i’m installing React js?

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. You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.

HI @deepanshu188 !

Welcome to the forum!

When installing react make sure to use one of these commands.

npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app

I usually use the npx option when installing it for my projects. npm and yarn work too.
Just pick one of those options when installing react your for projects.

But I have never tried to install react globally.
Based on your error message, it looks like you can’t do that anyway.

I would suggest uninstalling it globally and then checking to make sure it is uninstalled.

You can read through this helpful stackoverflow answer on how to uninstall react globally and install it the preferred way.

I tried globally uninstalling but it still doesn’t prevent this error.

Maybe you can try reading through other stackoverflow answers to help you troubleshoot the issue.

You can look into this stackoverflow answer

You can also google uninstall react globally stack overflow and there are a lot of posts on there to.

Good luck!

But i’m not getting any error on uninstalling it.

This is what i’m getting on the terminal.

up to date, audited 1 package in 284ms

Is that what you get when you run the npx command?
Is there more to the message?

It may be that you have an outdated version of create-react-app in the package.json file. You can manually open the file and remove that line from it, then reinstall the package with the command you were issuing.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.