Vue.js Installation Guide
Try Vue Online
- Playground: Try directly in the Vue Playground
- JSFiddle: Use this JSFiddle template for plain HTML setup
- StackBlitz: Try a complete build setup in your browser on StackBlitz
- Interactive Tutorial: Watch the Scrimba tutorial for recommended setup walkthrough
Creating a Vue Application (Recommended)
Prerequisites
- Familiarity with the command line
- Install Node.js version ^20.19.0 || >=22.12.0
Using Official Scaffolding Tool
Run one of the following commands in your terminal:
# npm
npm create vue@latest
# pnpm
pnpm create vue@latest
# yarn (v1+)
yarn create vue
# yarn (Modern v2+)
yarn create vue@latest
# yarn (^v4.11)
yarn dlx create-vue@latest
# bun
bun create vue@latest
Project Configuration Options
You will be prompted with several optional features:
- Project name: Your project name
- Add TypeScript?: Whether to add TypeScript support
- Add JSX Support?: Whether to add JSX support
- Add Vue Router: For Single Page Application development
- Add Pinia: For state management
- Add Vitest: For unit testing
- Add End-to-End Testing: Cypress/Nightwatch/Playwright
- Add ESLint: For code quality
- Add Prettier: For code formatting
- Add Vue DevTools 7: For debugging (experimental)
Starting the Development Server
cd <your-project-name>
npm install
npm run dev
Production Build
npm run build
Using Vue from CDN
Global Build
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<div id="app">{{ message }}</div>
<script>
const { createApp } = Vue
createApp({
data() {
return {
message: 'Hello Vue!'
}
}
}).mount('#app')
</script>
ES Module Build
<div id="app">{{ message }}</div>
<script type="module">
import { createApp } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'
createApp({
data() {
return {
message: 'Hello Vue!'
}
}
}).mount('#app')
</script>
Enabling Import Maps
<script type="importmap">
{
"imports": {
"vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js"
}
}
</script>
<div id="app">{{ message }}</div>
<script type="module">
import { createApp } from 'vue'
createApp({
data() {
return {
message: 'Hello Vue!'
}
}
}).mount('#app')
</script>
Development Environment Recommendations
- IDE: Visual Studio Code + Vue - Official extension
- Build Tool: Vite (included in official scaffolding)
- Local Server: For ES modules, use
npx serveto start a local HTTP server - Alternative for Simple Cases: Consider petite-vue for lightweight scenarios
Next Steps
After installation, proceed to learn about Vue's core concepts in the Introduction section and explore the comprehensive documentation to build your applications effectively.
