Skip to content

Installation FAQ ​

Common questions about installing and setting up VitePress.

Prerequisites ​

Q: What do I need to install VitePress? ​

A: Requirements:

  • Node.js 16.0 or higher
  • A package manager (npm, yarn, pnpm, or bun)
  • A code editor (VS Code recommended)

Q: How do I check my Node.js version? ​

A: Run this command:

bash
node --version

If you need to update Node.js, visit nodejs.org

Installation Methods ​

Q: What's the easiest way to get started? ​

A: Use the create command:

bash
npm create vitepress@latest my-docs
cd my-docs
npm install
npm run docs:dev

Q: Can I add VitePress to an existing project? ​

A: Yes, install as a dependency:

bash
npm install -D vitepress

Then add scripts to your package.json:

json
{
  "scripts": {
    "docs:dev": "vitepress dev docs",
    "docs:build": "vitepress build docs",
    "docs:preview": "vitepress preview docs"
  }
}

Package Managers ​

Q: Which package manager should I use? ​

A: All work well:

  • npm: Default, comes with Node.js
  • yarn: Fast, good for monorepos
  • pnpm: Efficient disk usage
  • bun: Fastest, newer option

Q: I'm getting permission errors during installation ​

A: Solutions:

  • Use sudo (not recommended)
  • Configure npm to use a different directory
  • Use a Node.js version manager (nvm)
  • Use yarn or pnpm instead

Common Installation Issues ​

Q: Installation fails with "EACCES" error ​

A: Fix npm permissions:

bash
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
source ~/.profile

Q: "command not found" error after installation ​

A: Check:

  1. Node.js is properly installed
  2. npm/yarn is in your PATH
  3. Package was installed globally if needed
  4. Restart your terminal

Q: Installation is very slow ​

A: Try:

  • Use a different registry: npm config set registry https://registry.npmmirror.com/
  • Use yarn or pnpm
  • Check your internet connection
  • Clear npm cache: npm cache clean --force

Version Management ​

Q: How do I update VitePress? ​

A: Update to latest version:

bash
npm update vitepress
# or
npm install vitepress@latest

Q: How do I install a specific version? ​

A: Specify the version:

bash
npm install vitepress@1.0.0

Q: How do I check which version is installed? ​

A: Check your package.json or run:

bash
npm list vitepress

Development Environment ​

Q: What editor should I use? ​

A: Recommended editors:

  • VS Code: Best Vue/Vite support
  • WebStorm: Full-featured IDE
  • Vim/Neovim: With Vue plugins
  • Sublime Text: With Vue syntax

Q: Are there useful VS Code extensions? ​

A: Recommended extensions:

  • Vue Language Features (Volar)
  • TypeScript Vue Plugin (Volar)
  • Markdown All in One
  • Auto Rename Tag
  • Bracket Pair Colorizer

VitePress Development Guide