title: vue js - Cannot read property 'use' of undefined
body: <p>I'm using vue js 3, but im taking this error. I try to use router.</p>
  <p>my main.js file is in here:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { createApp } from 'vue'
  import App from './App.vue'
  
  import VueRouter from 'vue-router'  // i added this
  import Vue from 'vue';    // and this
  Vue.use(VueRouter);       // and this
  
  createApp(App).mount('#app')</code></pre>
  </div>
  </div>
  </p>
  <p>my package.json file is in here:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "name": "router",
    "version": "0.1.0",
    "private": true,
    "scripts": {
      "serve": "vue-cli-service serve",
      "build": "vue-cli-service build",
      "lint": "vue-cli-service lint"
    },
    "dependencies": {
      "core-js": "^3.6.5",
      "vue": "^3.0.0",
      "vue-router": "^3.5.1"
    },
    "devDependencies": {
      "@vue/cli-plugin-babel": "~4.5.0",
      "@vue/cli-plugin-eslint": "~4.5.0",
      "@vue/cli-service": "~4.5.0",
      "@vue/compiler-sfc": "^3.0.0",
      "babel-eslint": "^10.1.0",
      "eslint": "^6.7.2",
      "eslint-plugin-vue": "^7.0.0"
    },
    "eslintConfig": {
      "root": true,
      "env": {
        "node": true
      },
      "extends": [
        "plugin:vue/vue3-essential",
        "eslint:recommended"
      ],
      "parserOptions": {
        "parser": "babel-eslint"
      },
      "rules": {}
    },
    "browserslist": [
      "&gt; 1%",
      "last 2 versions",
      "not dead"
    ]
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Where am i wrong? The error message is:
  Uncaught TypeError: Cannot read property 'use' of undefined</p>
  <p>If you help me i will be glad.</p>