← Back to Vue.js Course | Chapter 1: Introduction | Lesson 3 of 7

Vue Install करना

आप एक script tag से Vue add कर सकते हैं, या official scaffolding tool से एक पूरा project बना सकते हैं।

In this page:

  1. Vue Install करना
Syntax
markup
npm create vue@latest
cd project-name
npm install
npm run dev

Vue Install करना

Quick experiments के लिए CDN इस्तेमाल करें। Real projects के लिए npm create vue@latest चलाएँ, जो Vite, optional Router, Pinia, testing, और linting set up करता है। फिर npm install और npm run dev hot reload वाला एक local dev server शुरू करते हैं।

Note: Vue projects default से Vite इस्तेमाल करते हैं, जो लगभग तुरंत शुरू होता है।

उदाहरण: Installing Vue

bash
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
$ npm create vue@latest
✔ Project name: my-vue-app
✔ Add Vue Router? Yes
✔ Add Pinia? Yes
$ cd my-vue-app
$ npm install
$ npm run dev
  VITE v5.2.0  ready in 320 ms
  ➜  Local:   http://localhost:5173/
</body>
</html>

⚠️ Run this in your own terminal or Node.js environment.

Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. नए projects के लिए old Vue CLI इस्तेमाल करना
  2. scaffolding के बाद npm install भूल जाना
  3. बहुत पुराने node versions चलाना
चैप्टर सारांश
  • npm create vue@latest एक project scaffold करता है
  • Vite dev server है
  • npm run dev इसे शुरू करता है
  • CDN को कोई tools नहीं चाहिए
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.