Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not create app using create-react-app

When I try to create an app using create-react-app that give an error

error [email protected]: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0".

error Found incompatible module info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

My node version is 8.9.3

My NPM version is 6.4.1

My create-react-app version is 1.5.2

The project cannot create given error are display.

like image 254
Bhautik Chudasama Avatar asked Oct 21 '18 05:10

Bhautik Chudasama


People also ask

Why cant I use create React app?

If you really need create-react-app , you might need to reinstall Node and reconfigure your dependencies to ensure you have a fresh start with Node, npm, npx, and the like.

Can I use React to create app?

Create React App is a comfortable environment for learning React, and is the best way to start building a new single-page application in React. npx on the first line is not a typo — it's a package runner tool that comes with npm 5.2+.

Is create React app still supported?

Create-react-app no longer supported #12314 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 before using create-react-app again.

Can I use React without create React app?

No more introduction let's start creating React app without using create-react-app. First of all you need to have install node in your computer. To check that you can run following command in your CLI. Now let's initialise our React project using init command.


2 Answers

I had this issue because my node package wasn't up-to-date. I got this error message:

error [email protected]: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.10.0"

After some Googling around I stumbled upon this... https://www.surrealcms.com/blog/how-to-upgrade-or-downgrade-nodejs-using-npm.html

And found that my solution was to use this npm command to update the latest stable version of node.

sudo n stable

A Voilà! 🎉🎉🎉

like image 65
Suz Avatar answered Sep 29 '22 18:09

Suz


The problem is clearly due to incompatible node version.

Install a program called n that will let you switch between Node versions.

sudo npm install -g n

Update to the latest stable version of Node.

sudo n stable

Now use create-react-app

npm install create-react-app

create-react-app myapp
like image 20
Raunak Singha Avatar answered Sep 29 '22 19:09

Raunak Singha