LoginSignup
2
2

More than 3 years have passed since last update.

Nuxt v2.7 で実行時に「TypeError: fsevents.watch is not a function」のエラーで起動できない

Last updated at Posted at 2019-05-27

Nuxt v2.7.1にしたら、起動できなくなった

Nuxt v2.7.x で、yarn dev 実行時に以下のエラーが出た。

fsevents-handler.js
  const stop = fsevents.watch(path, callback);
                        ^

TypeError: fsevents.watch is not a function
    at createFSEventsInstance (/Users/masaakikakimoto/Documents/nuxt_firebase_sns/node_modules/@nuxt/builder/node_modules/chokidar/lib/fsevents-handler.js:57:25)
    at setFSEventsListener (/Users/masaakikakimoto/Documents/nuxt_firebase_sns/node_modules/@nuxt/builder/node_modules/chokidar/lib/fsevents-handler.js:111:16)
    at FsEventsHandler._watchWithFsEvents (/Users/masaakikakimoto/Documents/nuxt_firebase_sns/node_modules/@nuxt/builder/node_modules/chokidar/lib/fsevents-handler.js:296:18)
    at initWatch (/Users/masaakikakimoto/Documents/nuxt_firebase_sns/node_modules/@nuxt/builder/node_modules/chokidar/lib/fsevents-handler.js:433:27)
    at LOOP (fs.js:1787:14)
    at process._tickCallback (internal/process/next_tick.js:176:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

調べると以下のIsuueがHit
https://github.com/nuxt/nuxt.js/issues/5725

nodejs のバージョンを下げることで解決した。

とりあえずnode v10.15.3でNuxtが正常起動することを確認しました。

(※v12系やv9系では、エラーが出るようだ。)

※追記 おまけ

気を良くして、いろいろとパッケージを追加していたら、またまたNuxtが起動しなくなった。

エラー内容


 ERROR  Failed to compile with 1 errors                       friendly-errors 17:07:19

This dependency was not found:                                friendly-errors 17:07:19
                                                              friendly-errors 17:07:19
* core-js/modules/es7.promise.finally in ./.nuxt/client.js    friendly-errors 17:07:19
                                                              friendly-errors 17:07:19
To install it, you can run: npm install --save core-js/modules/es7.promise.finally

corejs v2.6.5を入れ直すことで解決した。

yarn add core-js@latest2.6.5
2
2
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
2
2