結論
とりあえず指示に従って、CreateReactAppのバージョン上げて。。
詳細
発端
コマンドプロント
D:\directory>npx create-react-app hp --template typescript
You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.2).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
npm ERR! code 1
npm ERR! path D:\directory
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-react-app hp --template typescript
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kyoya0819\AppData\Local\npm-cache\_logs\2021-02-13T15_34_13_354Z-debug.log
失敗するぞ?
日本語訳してみる
You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.2).
「お兄さん。えらい古いcreate-react-app使っとるなぁ。4.0.1やで?最新の4.0.2より前やで?」
We no longer support global installation of Create React App.
「あっしら、そんな長くサポートできひんよ。」
Please remove any global installs with one of the following commands:
「コマンド教えたるから、グローバルインストールしたやつ削除しといてな。」
再インストールする
コマンドプロント
> npm uninstall -g create-react-app
> npm install -g create-react-app
バージョンを確認する
コマンドプロント
> npx create-react-app --version
=> 4.0.2
よっしゃ
再度実行 => 問題発生
コマンドプロント
D:\directory>npx create-react-app hp --template typescript
You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.2).
(以下略)
なんでや!!!なんでなんや!!
解決
コマンドプロント
> yarn global remove create-react-app
こっちもインストールしてたの忘れてました。。。
最後に
Yarnのほうの消した、Create React Appのパスが残っていたので消しました。
消したファイルは以下の二ファイルです。
C:\Users\ユーザー名\AppData\Local\Yarn\bin\create-react-app
C:\Users\ユーザー名\AppData\Local\Yarn\bin\create-react-app.cmd
探す場合は、
コマンドプロント
> where.exe create-react-app
です。
まとめ
忠告を無視したらあかん!
あとがき
似非関西弁使ったから、関西人に殺されそう。