ただの個人的備忘録なのであまり詳しく書いてはないです。
前提
環境/バージョン | 内容 |
---|---|
OS | macOS Catalina 10.15.5 |
node | 13.12.0 |
yarn | 1.22.4 |
npm | 6.14.4 |
エラー詳細
Nuxt.jsプロジェクトにFirebaseのライブラリを追加したらビルド時に「These dependencies were not found」エラーが発生。
ビルドエラーは以下のような感じです。
These dependencies were not found: friendly-errors 14:45:34
friendly-errors 14:45:34
* core-js/modules/es6.array.find in ./.nuxt/client.js friendly-errors 14:45:34
* core-js/modules/es6.array.from in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/es6.array.iterator in ./.nuxt/client.js friendly-errors 14:45:34
* core-js/modules/es6.date.to-string in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/es6.function.name in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/es6.object.assign in ./.nuxt/client.js friendly-errors 14:45:34
* core-js/modules/es6.object.keys in ./.nuxt/client.js friendly-errors 14:45:34
* core-js/modules/es6.object.to-string in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js and 1 other
* core-js/modules/es6.promise in ./.nuxt/client.js friendly-errors 14:45:34
* core-js/modules/es6.regexp.constructor in ./.nuxt/utils.js friendly-errors 14:45:34
* core-js/modules/es6.regexp.match in ./.nuxt/client.js friendly-errors 14:45:34
* core-js/modules/es6.regexp.replace in ./.nuxt/client.js, ./.nuxt/components/nuxt.js
* core-js/modules/es6.regexp.search in ./.nuxt/utils.js friendly-errors 14:45:34
* core-js/modules/es6.regexp.split in ./.nuxt/utils.js, ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-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/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/es6.string.ends-with in ./.nuxt/utils.js friendly-errors 14:45:34
* core-js/modules/es6.string.includes in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/es6.string.iterator in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/es6.string.repeat in ./.nuxt/utils.js friendly-errors 14:45:34
* core-js/modules/es6.string.starts-with in ./.nuxt/utils.js friendly-errors 14:45:34
* core-js/modules/es6.symbol in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/es7.array.includes in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/es7.object.get-own-property-descriptors in ./.nuxt/index.js
* core-js/modules/es7.promise.finally in ./.nuxt/client.js friendly-errors 14:45:34
* core-js/modules/es7.symbol.async-iterator in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
* core-js/modules/web.dom.iterable in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
friendly-errors 14:45:34
To install them, you can run: npm install --save core-js/modules/es6.array.find core-
core-js
関連でエラーが吐いてるのがわかります。
対処方法
出力されたエラー通りのcore-jsをインストールしても解決しませんでした。
調べた結果core-js v-2系が必要みたい。
なのでちゃんと適したバージョンでインストールしなおします。
yarn add core-js@^2.6.11
僕はyarnで解決しましたが、npmの場合は以下のコマンドを参考に。
npm install --save core-js@2