Help us understand the problem. What is going on with this article?

Nuxt 2.5.0 にバージョンアップしたら core-js のエラーが出るようになった

事象

2019年3月21日、Nuxt.jsのv2.5.0がリリースされました 🎊🎊🎊

https://twitter.com/nuxt_js/status/1108728812945227776

うっきうきでバージョンアップしたら

 ERROR  in ./.nuxt/client.js                                                                                                                                  friendly-errors 12:09:02

Module build failed (from ./node_modules/@nuxt/webpack/node_modules/babel-loader/lib/index.js):                                                               friendly-errors 12:09:02
Error: [BABEL] /path/to/project/.nuxt/client.js: Invalid Option: corejs is not a valid top-level option.
        Maybe you meant to use 'targets'? (While processing: "/path/to/project/node_modules/@nuxt/babel-preset-app/src/index.js$0")
    at validateTopLevelOptions (/path/to/project/node_modules/@nuxt/babel-preset-app/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
    at normalizeOptions (/path/to/project/node_modules/@nuxt/babel-preset-app/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
    at _default (/path/to/project/node_modules/@nuxt/babel-preset-app/node_modules/@babel/preset-env/lib/index.js:168:37)
    at /path/to/project/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
    at loadDescriptor (/path/to/project/node_modules/@nuxt/webpack/node_modules/@babel/core/lib/config/full.js:165:14)
    at cachedFunction (/path/to/project/node_modules/@nuxt/webpack/node_modules/@babel/core/lib/config/caching.js:33:19)
    at loadPresetDescriptor (/path/to/project/node_modules/@nuxt/webpack/node_modules/@babel/core/lib/config/full.js:235:63)
    at config.presets.reduce (/path/to/project/node_modules/@nuxt/webpack/node_modules/@babel/core/lib/config/full.js:77:21)
    at Array.reduce (<anonymous>)
    at recurseDescriptors (/path/to/project/node_modules/@nuxt/webpack/node_modules/@babel/core/lib/config/full.js:74:38)
    at recurseDescriptors (/path/to/project/node_modules/@nuxt/webpack/node_modules/@babel/core/lib/config/full.js:94:27)
    at loadFullConfig (/path/to/project/node_modules/@nuxt/webpack/node_modules/@babel/core/lib/config/full.js:108:6)
    at process.nextTick (/path/to/project/node_modules/@nuxt/webpack/node_modules/@babel/core/lib/transform.js:28:33)
    at process._tickCallback (internal/process/next_tick.js:61:11)
                                                                                                                                                              friendly-errors 12:09:02
 @ multi eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&name=client&path=/__webpack_hmr/client ./.nuxt/client.js
                                                                                                                                                              friendly-errors 12:09:02

なんかすごい怒られた。

対処

公式では yarn.lock, package-lock.jsonを削除してからバージョン上げてね って書いてあったので諸々削除してやったけど効果なし。

どうも、node_modulesを削除してほんとにクリーンインストールしないといけないっぽかった。

$ rm -r node_modules
$ npm install

全消し&インストールできちんと起動するようになった。めでたし。

メモ裏

Nuxtのバージョンが上がるごとにクリーンインストールはちょいとリスキーすぎでは...

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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした