0

I want to run create react app. I run the command:

npx create-react-app client 

but I get this error:

You are running Node 10.9.0. Create React App requires Node 14 or higher. Please update your version of Node.

I updated it with latest version and using node -v it is showing version v18.13.0. But after that I'm still getting same error.

How do I solve the problem?

2
  • Let's make this a canonical for "what should I do if updating Node.js didn't work?" It seems to come up often enough it could use one. Commented Jan 20, 2023 at 11:39
  • 1
    Please specify your OS. It might be an issues with path evironment variables. Commented Jan 20, 2023 at 11:40

4 Answers 4

1

You can manually define which Node engine to use for your project in package.json file.

{ "name": "client", "version": "0.1.0", "private": true, "engines": { "node": ">=18" }, "dependencies": { "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "axios": "^1.2.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } } 
Sign up to request clarification or add additional context in comments.

Comments

1

If using Mac, install NVM via brew.

brew install nvm 

then

nvm install node 

after that run

npx create-react-app client 

Comments

0

Things to try when this sort of thing happens:

  • If you haven't already, close the command prompt / terminal window where you're running this and open a new one.

  • If that doesn't work, completely reboot (mostly a Windows thing).

  • If that doesn't work, completely uninstall Node.js, reboot (mostly a Windows thing), and then install the latest.

Usually if the first two don't solve the problem, the last will.

Comments

-1

I got answer for this from other site which you can use

npm uninstall -g create-react-app npm install -g [email protected] create-react-app my-app --scripts-version 3.1.1 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.