LoginSignup
9
3

More than 5 years have passed since last update.

【webpack】[vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.

Last updated at Posted at 2018-11-12

[vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.

Error | エラー

webpack で vue-loader を使い、single file component をコンパイルする際に以下のエラーが出ることがある。

[vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.

Solution | 解決方法

エラー文にも書いてある通り、vue-template-compiler をインストールすれば良い。

# using npm
npm install vue-template-compiler --save-dev

# using yarn
yarn add vue-template-compiler --dev

Supplement | 補足

Vue の single file component は、
.vue ファイル内に以下のように template (HTML), script (JavaScript), style (CSS) を記述することができる。

<template>
  <div>
    <h1>Hello World!</h1>
  </div>
</template>


<script>
</script>


<style>
</style>

更に以下のエラーが出たら

vue&type=style&index=0&lang=css

こちら https://qiita.com/7110/items/b42748c1183a7069e7a4

9
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
3