2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

eslintを実行したらSIGSEGVで終了してしまう

Last updated at Posted at 2024-12-19

発生していたエラー

ある日、いつも通りeslintを実行しようとしたところ、SIGSEGVで終了してしまうことが起きた。

$ eslint '**/*.ts'
error Command failed with signal "SIGSEGV".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

対処法

原因を探っていたら、node_modules/bin/eslint.jsの以下のv8-compile-cacheをrequireしている行でエラーになっていることがわかった。

// to use V8's code cache to speed up instantiation time
require("v8-compile-cache");

v8-compile-cacheで類似のエラーを探していたところ、どうやらv8-compile-cacheのキャッシュが原因そうとのことだった。

v8-compile-cacheのREADMEによると、

Set the environment variable DISABLE_V8_COMPILE_CACHE=1 to disable the cache.

Cache directory is defined by environment variable V8_COMPILE_CACHE_CACHE_DIR or defaults to <os.tmpdir()>/v8-compile-cache-<V8_VERSION>.

とのことなので、キャッシュを消してみたところeslintが動くようになった。

$ rm -fr $(node -r 'node:os' -e 'console.log(os.tmpdir())')/v8-compile-cache-*

たびたび起こるが、現時点ではSIGSEGVになる条件がわかっておらず、上記の対応で誤魔化している。

2
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?