Create a React + Typescript project with Vite

Ye Min Ko
Learn React
Published in
2 min readJul 12, 2023
React + Typescript with Vite

Summary

These days, npx create-react-app is not enough to create a react project. There are plenty of ways to create the project but if you want to create a SPA (single page application) that supports typescript with blazing fast development experience, try Vite. Why? Take a look up here!

Prerequisites

  • Make sure you have installed Node.js version 16+

Create Vite Project

Run the following command in the terminal.

npm create vite@latest

You’ll need to enter the project name like this.

Entering project name

After that, you’ll have to choose a framework that you want to use. In this case, we’ll choose React.

Choosing a framework

And then, choose Typescript.

Choosing a variant

And it’ll show like this. All you need to do is go to the project root folder and run npm install .

Project Created

Finally, run npm run dev to serve as a local development.

Access Permission Error

If you encounter with the following problem, use sudo npm run dev .

Access Permission Error

Done

That’s it. Go and write some code. Happy hacking :)

--

--

Ye Min Ko
Learn React

🌐 Web Developer | 👀 Self-Learner | 👨‍💻 An Introvert