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

More than 3 years have passed since last update.

M1マシンでflowが起動しない問題の対応

Posted at

事象

M1(apple silicon)マシンでrosettaを使って入れたnode.jsで npx flow などでflowを起動すると以下のようなエラーが出て起動に失敗する

Launching Flow server for /Users/sogasawara/progate
Spawned flow server (pid=6001)
Logs will go to /private/tmp/flow/zSUserszSsogasawarazSprogate.log
Monitor logs will go to /private/tmp/flow/zSUserszSsogasawarazSprogate.monitor_log
Launching Flow server for /Users/sogasawara/progate
Spawned flow server (pid=6008)
Logs will go to /private/tmp/flow/zSUserszSsogasawarazSprogate.log
Monitor logs will go to /private/tmp/flow/zSUserszSsogasawarazSprogate.monitor_log
Launching Flow server for /Users/sogasawara/progate
Spawned flow server (pid=6012)
Logs will go to /private/tmp/flow/zSUserszSsogasawarazSprogate.log
Monitor logs will go to /private/tmp/flow/zSUserszSsogasawarazSprogate.monitor_log
Lost connection to the flow server (0 retries remaining): -Out of retries, exiting!

ログ

[2021-01-27 17:22:16.301] argv=/Users/sogasawara/progate/node_modules/flow-bi
Unhandled exception: Unix.Unix_error(Unix.EINVAL, "ftruncate", "")
Raised by primitive operation at file "hack/heap/sharedMem.ml", line 82, char
Called from file "hack/heap/sharedMem.ml", line 146, characters 5-26

環境

Mac Mini(M1), node v10.16.3 (rosetta), flow 0.90.0

解決策(workaround)

.flowconfigに以下のオプションを追加する

[options]
sharedmemory.heap_size=2147483648

なお、公式のissueに問題の対応方法が書いてあります
https://github.com/facebook/flow/issues/8538

heap_sizeはマシンのメモリによって変わるとか。

私のマシンはMac miniのメモリ16GBですが上記の値で動きましたがマシンによって調整が必要そうです

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