4

I am trying to create a new react project, but when I run npx create-react-app tik-tok-clone I get the following error

    Creating a new React app in C:\Users\mwars\Documents\GitHub\TikTok-Clone\tik-tok-clone.

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

yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.12.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts cra-template --cwd C:\Users\mwars\Documents\GitHub\TikTok-Clone\tik-tok-clone has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting tik-tok-clone/ from C:\Users\mwars\Documents\GitHub\TikTok-Clone
Done.

I've been trying to figure it out for a while now and just can't get it to work.

5
  • On Stack Overflow, don't show pictures of text. Copy the text into the question and format it so that it's easy to read, copy, and search. Commented Oct 26, 2020 at 2:18
  • 1
    The problem is your nodeJS version. It is asking for version ^10, ^12 and >=14. Can you run node --version? Commented Oct 26, 2020 at 2:45
  • @WillianGaspar I get v13.12.0 Commented Oct 26, 2020 at 2:47
  • @WillianGaspar how do I change my nodejs version Commented Oct 26, 2020 at 2:53
  • try this: phoenixnap.com/kb/update-node-js-version. But before, try this post, see it helps: stackoverflow.com/questions/56617209/… Commented Oct 26, 2020 at 3:00

2 Answers 2

6

I am was dealing with the same problem and have managed to understand and fix it. I will try to explain it below.

The issue:

error [email protected]: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.12.0"

This is telling you that the create_react_app module is only compatible with versions 10, 12, or greater than 14 of node and you are using 13.12.0.

The solution

To fix this error you need to either upgrade or downgrade your current version of node.

One way to do this is to use NVM (node version manager) to manage multiple versions of node.

To install it with either Linux or Mac you can use either of the following commands

For Wget, run the following command on the terminal:

  wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

For CURL, run the following:

  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

You will want to change the version number in the commands to the latest stable version.

Once you have downloaded it successfully restart the terminal or you won't be able to find it. If this fails you may need to reset your computer.

If you have NVM installed running the following should show you the current version of it your using.

nvm --version

You can then use the following command to list available versions of node

nvm ls-remote

Select a compatible version and install it like so

nvm install 14.15.0

Running

node -v 

Should show this as your current version if not try

nvm use v14.15.0

You should now have no issues running

npx create-react-app tik-tok-clone
Sign up to request clarification or add additional context in comments.

Comments

2

It worked for me after running these commands.

  1. sudo npm cache clean -f //clear you npm cache

  2. sudo npm install -g n install n //(this might take a while)

  3. sudo n stable upgrade //to the current stable version

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.