underfin / vite-plugin-vue2

Vue2 plugin for Vite
620 stars 83 forks source link

Error: Cannot find module 'vue-template-compiler' #171

Closed ryuhojin closed 2 years ago

ryuhojin commented 2 years ago

when i run vite, i received error message

error when starting dev server:
Error: Cannot find module 'vue-template-compiler'

how can i solve? my version 1.9.3

my package.json

    "dependencies": {
        "axios": "^0.25.0",
        "vite": "^2.7.13",
        "vue": "^2.6.14",
        "vue-router": "^3.5.3",
        "vuex": "^3.6.2"
    },
    "devDependencies": {
        "@vitejs/plugin-legacy": "^1.6.4",
        "sass": "^1.49.0",
        "vite-plugin-compression": "^0.4.0",
        "vite-plugin-vue2": "^1.9.3"
    }

vite.config.js

    plugins: [
      createVuePlugin(/* options */),
    ],
antfu commented 2 years ago

It's a peerDeps, just run npm i -D vue-template-compiler should work for you.