1

I'm trying to create a react project using vite but I'm getting an error while running npm create vite@latest I'm on a fresh new ubuntu, I've just created a directory, opened a terminal inside that directory then ran sudo apt install npm followed by npm create vite@latest but I'm getting this error:

enter image description here

What am I doing wrong? Since my setup is new have I forgotten to install something?

2
  • 1
    What version of Node are you running? Commented Sep 17, 2022 at 19:24
  • 1
    @tony19 v12.22.9 Commented Sep 17, 2022 at 19:45

1 Answer 1

3

You're using a version of Node that vite@latest (currently Vite 3.x) no longer supports. Vite 3 requires Node 14.18 or newer:

Node.js Support

Vite no longer supports Node.js 12 / 13 / 15, which reached its EOL. Node.js 14.18+ / 16+ is now required.

The solution is to install one of the supported Node versions on your machine, and retry the npm create vite@latest command afterward.

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

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.