LoginSignup
0
0

More than 1 year has passed since last update.

Nuxt.jsをインストールしたら大量のワーニングが出た件

Posted at

概要

今まで普通にyarn installでインストールし、yarn devで立ち上がっていたプロジェクトで、
yarn installし直したら大量に以下のエラーが出現した

 WARN  [@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead.   

このときのパッケージ情報は以下

  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "core-js": "^3.19.3",
    "nuxt": "^2.15.8",
    "vue": "^2.6.14",
    "vue-server-renderer": "^2.6.14",
    "vue-template-compiler": "^2.6.14",
  },

原因

こちらにある通り、パッケージのバージョン指定を修正したところ、yarn devで立ち上げ時のワーニングは消え去りました。
ただ、yarn generateしたところまたもや同じ内容のワーニングが発生。
原因追求のためyarn.lockを確認すると以下の記載を発見

vue-template-compiler@^2.6.12, vue-template-compiler@^2.6.14:
  version "2.7.8"
  resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.7.8.tgz#eadd54ed8fbff55b7deb07093a976c07f451a1dc"
  integrity sha512-eQqdcUpJKJpBRPDdxCNsqUoT0edNvdt1jFjtVnVS/LPPmr0BU2jWzXlrf6BVMeODtdLewB3j8j3WjNiB+V+giw==
  dependencies:
    de-indent "^1.0.2"
    he "^1.2.0"

package.jsonでバージョン指定してる意味がなく、最新の2.7系が使用されている模様…
依存してるパッケージのバージョン指定ってできるのか?と調べたところできるらしい

こちらを参考にpackage.jsonを更新

  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "core-js": "^3.19.3",
    "nuxt": "^2.15.8",
    "vue": "~2.6.14", ★修正
    "vue-server-renderer": "~2.6.14", ★修正
    "vue-template-compiler": "~2.6.14", ★修正
  },
  "resolutions": { ★追加
    "vue-template-compiler": "~2.6.14"
  }

yarn generateyarn devのどちらも問題なく動きました〜

0
0
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
0
0