{"id":10683,"library":"create-vue","title":"Vue Project Scaffolding (create-vue)","description":"create-vue is the official and recommended command-line interface (CLI) tool for quickly scaffolding new Vue.js projects. Currently at stable version 3.22.2, it is actively maintained by the Vue.js core team with frequent releases to align with Vue, Vite, and ecosystem updates. Its primary differentiator from the legacy Vue CLI is its foundation on Vite, providing a significantly faster development experience through rapid cold starts and instant Hot Module Replacement (HMR). Unlike Vue CLI, create-vue primarily acts as a scaffolding utility, generating a pre-configured project and then delegating subsequent operations to Vite, allowing projects to fully leverage the Vite plugin ecosystem. Since v3.22.0, it defaults to generating TypeScript projects, reflecting the modern Vue development landscape.","status":"active","version":"3.22.2","language":"javascript","source_language":"en","source_url":"https://github.com/vuejs/create-vue","tags":["javascript"],"install":[{"cmd":"npm install create-vue","lang":"bash","label":"npm"},{"cmd":"yarn add create-vue","lang":"bash","label":"yarn"},{"cmd":"pnpm add create-vue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a command-line interface (CLI) tool for scaffolding new Vue.js projects and is not intended for direct programmatic import into other applications. It is executed via `npx` or `npm create` in the terminal.","wrong":"import { createVue } from 'create-vue'","symbol":"CLI Tool","correct":"npx create-vue@latest"}],"quickstart":{"code":"npm create vue@latest my-vue-app\n# Follow the interactive prompts to select features (TypeScript, Router, Pinia, etc.)\n\ncd my-vue-app\nnpm install\nnpm run dev\n\n# Alternatively, for a non-interactive setup with common features:\nnpm create vue@latest my-ts-app -- --typescript --router --pinia --vitest --playwright --eslint --prettier --git --force","lang":"javascript","description":"Demonstrates how to initialize a new Vue 3 project using the interactive `create-vue` CLI, prompting for features like TypeScript, Router, and Pinia. A non-interactive example shows direct flag usage for a full setup."},"warnings":[{"fix":"To create a JavaScript project, use `npm create vue@latest -- --no-typescript` or select JavaScript during the interactive prompt when asked.","message":"Starting with version 3.22.0, `create-vue` now generates TypeScript projects by default. Projects scaffolded without explicitly opting out of TypeScript will automatically include `.ts` files and a `tsconfig.json`.","severity":"breaking","affected_versions":">=3.22.0"},{"fix":"Use `npm create vue@latest` for Vue 3 projects or `npm create vue@legacy` for Vue 2 projects to guarantee the desired version.","message":"Always specify `@latest` or `@legacy` when running `npm create vue` to ensure you get the current or correct Vue 2 version. Omitting the tag may result in npm resolving to a cached and outdated package version.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Prioritize creating new projects with Vue 3 using `npm create vue@latest`. If Vue 2 is strictly required, be fully aware of its EOL status and associated risks.","message":"Vue 2 has officially reached End of Life (EOL). While `create-vue@legacy` can still scaffold Vue 2 projects, it is strongly recommended to use Vue 3 for all new projects due to the lack of official support, security updates, and continued development for Vue 2.","severity":"deprecated","affected_versions":"*"},{"fix":"Consider alternative E2E testing frameworks like Cypress or Playwright for new projects. For existing projects, manually integrate Nightwatch if necessary, or migrate to a supported E2E solution.","message":"Nightwatch support was dropped in `create-vue` version 3.22.1. Projects scaffolded with versions 3.22.1 or later will no longer offer Nightwatch as an option for end-to-end testing.","severity":"breaking","affected_versions":">=3.22.1"},{"fix":"Ensure your Node.js environment meets the specified requirements. Tools like `nvm` (Node Version Manager) can help manage multiple Node.js versions effectively.","message":"The `create-vue` package requires Node.js version `^20.19.0` or `>=22.12.0`. Using an older or unsupported Node.js version may lead to installation errors or unexpected behavior during project scaffolding.","severity":"gotcha","affected_versions":">=3.22.2"},{"fix":"In PowerShell, enclose the double dashes in single quotes: `npm create vue@latest '--' --typescript --router`.","message":"PowerShell users must quote the double dashes (`--`) when passing feature flags or options to `create-vue` via `npm create`. Forgetting to quote can lead to parsing errors.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure you specify the tag: `npm create vue@latest` (for Vue 3) or `npm create vue@legacy` (for Vue 2). If the issue persists, clear your npm cache with `npm cache clean --force`.","cause":"This error often occurs when the `@latest` or `@legacy` tag is omitted, or an outdated local npm cache is used, preventing resolution to the correct package version.","error":"npm ERR! code E404\nnpm ERR! 404 Not Found - GET https://registry.npmjs.org/create-vue\nnpm ERR! 404 \nnpm ERR! 404 'create-vue@latest' is not in the npm registry."},{"fix":"`create-vue` is executed via `npm create vue@latest` or `npx create-vue@latest` in your terminal. Do not attempt to import it into your JavaScript/TypeScript files.","cause":"`create-vue` is a command-line interface (CLI) tool, not a JavaScript/TypeScript library intended for direct programmatic import into application code.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"If a JavaScript project is desired, ensure to explicitly opt out of TypeScript during scaffolding: `npm create vue@latest -- --no-typescript`. For existing projects, you will need to manually remove TypeScript configurations and dependencies.","cause":"Since `create-vue` v3.22.0, new projects default to TypeScript. If you intended a JavaScript project but didn't explicitly opt out, TypeScript files and configurations will be present.","error":"Error: Cannot find module 'typescript' or similar TypeScript compilation errors in a seemingly JavaScript project."},{"fix":"Check the `engines.node` requirement for `create-vue` (e.g., `^20.19.0 || >=22.12.0`). Update your Node.js version using a tool like `nvm` to meet the package's requirements.","cause":"This is a generic npm error, but often related to Node.js version incompatibility. While `create-vue` itself specifies engines, if your Node.js version is outside the supported range, it could manifest as various installation issues.","error":"The 'engines.node' field is not supported. Please use the 'engines' field in your package.json."}],"ecosystem":"npm"}