Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
16
Help us understand the problem. What is going on with this article?
@shunk-py

Nuxt.js + Vuetifyのセットアップでcore-js関係の依存関係が見つからないと怒られた

More than 1 year has passed since last update.

前置きtmpl

自分用メモです・・・至らないところはご容赦ください。
気付き / 学習ベースで適宜アップデートしますが、ご指摘を頂いた場合、直ちに適切な情報に差し替えます。

怒られた

Nuxtをインストール。UI frameworkとしてVuetifyを選択。

npx create-nuxt-app <myproject>

その後、storybookなど、開発に必要なパッケージを追加していき、いざ

yarn dev

すると・・・

ERROR  Failed to compile with 32 errors                                                                                friendly-errors 08:19:15

These dependencies were not found:                                                                                      friendly-errors 08:19:15
                                                                                                                        friendly-errors 08:19:15
* core-js/modules/es6.array.find in ./.nuxt/client.js                                                                   friendly-errors 08:19:15
* core-js/modules/es6.array.iterator in ./.nuxt/client.js                                                               friendly-errors 08:19:15
* core-js/modules/es6.date.to-string in ./.nuxt/utils.js                                                                friendly-errors 08:19:15
* core-js/modules/es6.function.name in ./.nuxt/client.js                                                                friendly-errors 08:19:15
* core-js/modules/es6.object.assign in ./.nuxt/client.js                                                                friendly-errors 08:19:15
* core-js/modules/es6.object.keys in ./.nuxt/utils.js                                                                   friendly-errors 08:19:15
* core-js/modules/es6.object.to-string in ./.nuxt/axios.js, ./.nuxt/components/nuxt-link.client.js                      friendly-errors 08:19:15
* core-js/modules/es6.promise in ./.nuxt/client.js                                                                      friendly-errors 08:19:15
* core-js/modules/es6.regexp.constructor in ./.nuxt/utils.js                                                            friendly-errors 08:19:15
* core-js/modules/es6.regexp.match in ./.nuxt/client.js                                                                 friendly-errors 08:19:15
* core-js/modules/es6.regexp.replace in ./.nuxt/utils.js, ./.nuxt/components/nuxt.js                                    friendly-errors 08:19:15
* core-js/modules/es6.regexp.search in ./.nuxt/utils.js                                                                 friendly-errors 08:19:15
* core-js/modules/es6.regexp.split in ./.nuxt/utils.js, ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./.nuxt/components/nuxt-build-indicator.vue?vue&type=script&lang=js&
* core-js/modules/es6.regexp.to-string in ./.nuxt/utils.js                                                              friendly-errors 08:19:15
* core-js/modules/es6.string.includes in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js                      friendly-errors 08:19:15
* core-js/modules/es6.string.iterator in ./.nuxt/App.js                                                                 friendly-errors 08:19:15
* core-js/modules/es6.string.repeat in ./.nuxt/utils.js                                                                 friendly-errors 08:19:15
* core-js/modules/es6.string.starts-with in ./.nuxt/utils.js                                                            friendly-errors 08:19:15
* core-js/modules/es6.symbol in ./.nuxt/utils.js, ./.nuxt/components/nuxt-link.client.js                                friendly-errors 08:19:15
* core-js/modules/es7.array.includes in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js                       friendly-errors 08:19:15
* core-js/modules/es7.object.get-own-property-descriptors in ./.nuxt/utils.js                                           friendly-errors 08:19:15
* core-js/modules/es7.promise.finally in ./.nuxt/client.js                                                              friendly-errors 08:19:15
* core-js/modules/es7.symbol.async-iterator in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js                friendly-errors 08:19:15
* core-js/modules/web.dom.iterable in ./.nuxt/App.js, ./.nuxt/components/nuxt-link.client.js

いっぱい怒られた!
その後、怒られの通りcore-jsが入ってないのかな?と以下を試みる。

yarn add core-js

解決せず・・・同様のエラーが再表示。

原因と解決

どうやらcore-jsを3系→2系にダウングレードする必要があるらしい。
参考:https://github.com/nuxt/nuxt.js/issues/5315

再インストール。

yarn add core-js@2.6.9

再インストール後のpackage.json

package.json
{
  "name": "myproject",
  "version": "1.0.0",
  "description": "My Nuxt.js project",
  "author": "Shun Kimura",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "storybook": "start-storybook -p 9001 -c .storybook"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.3.6",
    "@nuxtjs/pwa": "^3.0.0-0",
    "babel-preset-vue": "^2.0.2",
    "core-js": "2.6.9",
    "nuxt": "^2.0.0"
  },
  "devDependencies": {
    "@nuxtjs/vuetify": "^1.0.0",
    "@storybook/vue": "^5.2.1",
    "babel-loader": "^8.0.6",
    "vue-loader": "^15.7.1",
    "vue-template-compiler": "^2.6.10"
  }
}

dev server起動。

yarn dev

動いた!

16
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
shunk-py
Web Developer Lv1.5

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
16
Help us understand the problem. What is going on with this article?