問題
次のように create-react-app を動かそうとした(環境は Mac):
$ npx create-react-app hello-react --typescript
$ cd hello-react
$ yarn start
しかしエラー:
#
# Fatal error in , line 0
# Check failed: U_SUCCESS(status).
#
#
#
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
原因
ググったところ同様の問題を扱った issue を見つけ、そのなかで次のコメントを見つけた:
If anyone is using Node.js 12.0.0, try to upgrade to 12.1.0. For me it is now working.
ちょうど 12.0.0 をインストールしていたので、12.1.0 にアップグレードすることにした。
解決
- まず、Node.js 12.1.0 をインストールして、バージョンを 12.1.0 に切り替える(ここの詳細は別の記事に書きました)
- yarn をグローバルにインストールし直す(
npm install -g yarn
) - プロジェクトルート(
hello-react
)に移動し、node_modules
を削除して、yarn install
し直す(一応) -
yarn start
し直す
これで無事アプリが起動!