1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Last updated at Posted at 2019-03-22

事象

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

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

 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のバージョンが上がるごとにクリーンインストールはちょいとリスキーすぎでは...

1
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
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?