Vue 3 Creating a Project
In the previous chapter Vue 3 Installation we used the npm init command to create a project; in this chapter we mainly introduce the npm create command to create a project and the vue ui command to open a graphical installation interface.
The recommended IDE setup for Vue development is Visual Studio Code + Vue - Official extension:

Other IDE support is as follows:
The npm create Command
Use the npm create command to create a Vue project, typically via Vite (Vue's officially recommended build tool).
In Vite, npm create is used to run a scaffolding tool (such as vite@latest) to quickly generate a new project template.
For Vite details, refer to:Vite Tutorial.
The syntax format for creating a project with the npm create command is as follows:
npm create vite@latest --template vue
Explanation:
-
npm create: The command for executing the project template; it creates a new project and initializes it from the given template. -
vite@latest: vite is the tool for creating Vue 3 projects;@latestspecifies using the latest version of Vite, ensuring your project is based on the latest Vite. If@latest,npmis not provided, it tries to use the currently installed version. -
: The folder name of the newly created project. The command creates a folder and places the template code inside it. For example, runningnpm create vite@latest my-vue-app --template vuecreates a folder namedmy-vue-appin the current directory and places the Vue project's template files inside it. -
--template vue:--template vuespecifies the template type to use. Vite supports multiple templates,vueis the template specifically provided for Vue 3. Other templates includevanilla,react,svelte, etc.
Next we create the runoob-vue3-app project:
npm create vite@latest
Running the above command will prompt you to enter a project name and select a framework:
> Project name: … runoob-vue3-app
? Select a framework: › - Use arrow-keys. Return to submit.
❯ Vanilla
Vue
React
Preact
Lit
Svelte
Solid
Qwik
Angular
Others
Vite supports multiple templates; common ones are:
vue: Vue 3 project (uses Vue 3 by default)vanilla: Basic template without a frameworkreact: React projectsvelte: Svelte projectpreact: Preact project- You can also choose other templates based on specific needs.
You can use the arrow keys to select; we choose Vue, then an option-variant screen appears where we can choose JavaScript Quick Start:
> Project name: … runoob-vue3-app
> Select a framework: › Vue
> Select a variant: › JavaScript
Scaffolding project in /Users/runoob/runoob-test/runoob-vue3-app...
Done. Now run:
cd runoob-vue3-app
npm install
npm run dev
After installation, we enter the project directory:
cd runoob-vue3-app
The entire directory structure is shown below:

Install dependencies and start the application:
npm install
npm run dev
Then open http://localhost:5173/to see the application interface:

Additionally, we can set our own port in the vite.config.js file, for example setting it to 3000 as follows:
Example
import
{
defineConfig
}
from
'vite'
import
vue from
'@vitejs/plugin-vue'
// https://vite.dev/config/
export
default
defineConfig
(
{
plugins
:
[
vue
(
)
]
,
server
:
{
port
:
3000
,
// Your own specified port number
}
,
}
)
The vue ui Command
Besides using the vue create command to create a project, we can also use a visual creation tool to create a project.
Run the command:
$ vue ui
-> Starting GUI...
-> Ready on http://localhost:8000
...
Running the above command pops up a project management interface in the browser:

We can click the **"Create"** option to create a project, choose "Create here" at the bottom, and select a path at the top of the page:

Then enter our project name, select npm as the package manager, and click Next:

For configuration, just choose the default:

Then wait for the installation to complete; the completed management interface is as follows:
