Setup Vue.js on Windows
Setting up Vue.js on Windows requires installing Node.js and configuring your development environment. This guide covers the complete setup process.
Prerequisites
Install Node.js and NPM
Method 1: Official Installer (Recommended)
- Download from nodejs.org
- Download the LTS version
- Run the installer with default settings
- Restart your computer
Method 2: Using Chocolatey
choco install nodejsMethod 3: Using Winget
winget install OpenJS.NodeJSVerify Installation
Open Command Prompt or PowerShell:
node --version
npm --versionCreate Vue.js Project
Using Official Vue CLI
npm create vue@latest my-vue-appYou’ll see interactive prompts:
- Project name
- Add TypeScript? (Optional)
- Add JSX Support? (Optional)
- Add Vue Router? (Recommended)
- Add Pinia? (Recommended)
- Add Vitest? (For testing)
- Add End-to-End Testing? (Optional)
- Add ESLint? (Recommended)
Navigate and Setup
cd my-vue-app
npm install
npm run devYour application opens at http://localhost:5173
Alternative: Vite Template
npm create vite@latest my-vue-app -- --template vue
cd my-vue-app
npm install
npm run devDevelopment Environment
Visual Studio Code
- Download from code.visualstudio.com
- Install VS Code
- Install essential extensions:
- Volar (Vue language support)
- Vue VSCode Snippets
- Prettier - Code formatter
- ESLint
- Auto Rename Tag
Windows Terminal (Recommended)
Install from Microsoft Store for better terminal experience with tabs and PowerShell integration.
Git for Windows
Download from git-scm.com
Browser Developer Tools
Install Vue.js DevTools:
Windows-Specific Configuration
Environment Variables
If Vue.js commands aren’t recognized:
- Search “Environment Variables” in Start Menu
- Click “Edit the system environment variables”
- Click “Environment Variables”
- Add to PATH:
C:\Program Files\nodejs\C:\Users\YourUsername\AppData\Roaming\npm
PowerShell Profile Setup
Create a PowerShell profile:
# Open PowerShell profile
notepad $PROFILE
# Add useful aliases
Set-Alias -Name vue-dev -Value "npm run dev"
Set-Alias -Name vue-build -Value "npm run build"
Set-Alias -Name vue-test -Value "npm run test"Advanced Setup
NVM for Windows
For managing multiple Node.js versions:
- Download from GitHub
- Install NVM4W
- Use Node.js versions:
nvm install 18
nvm use 18
nvm alias default 18Vue CLI Global Installation
npm install -g @vue/cli
vue create my-projectVue Router and Pinia
npm install vue-router@4 piniaProduction Build
Build for Production
npm run buildPreview Production Build
npm run previewDeploy to Netlify (Example)
npm install -g netlify-cli
netlify deploy --prod --dir=distCommon Issues and Solutions
Permission Denied Errors
# Clear npm cache
npm cache clean --force
# Use PowerShell as AdministratorPort Already in Use
# Find process using port 5173
netstat -ano | findstr :5173
# Kill the process
taskkill /PID <PID_NUMBER> /FNode.js Version Conflicts
# Use NVM to switch versions
nvm list
nvm use 18Yarn Integration (Optional)
Install Yarn as alternative package manager:
npm install -g yarnAdditional Tools
Windows Subsystem for Linux (WSL)
For Linux development environment:
- Install WSL from Microsoft Store
- Install Ubuntu
- Follow Linux setup guide inside WSL
Nuxt.js for Full-Stack Vue
npx nuxi init nuxt-app
cd nuxt-app
npm install
npm run devVue Testing Setup
npm install --save-dev @vue/test-utils vitest jsdomSources
For other platforms, check our Vue.js Linux setup or Vue.js macOS installation.