LoginSignup
122
21

More than 1 year has passed since last update.

React: Create React Appでプロジェクトがつくれない

Last updated at Posted at 2021-12-18

Create React Appがv5.0にアップデートされました。それにともなって、プロジェクトをつくろうとしたとき、バージョンが古いからダメと怒られてしまうかもしれません。

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).

解決法

npxのキャッシュをクリアしてください。

npx clear-npx-cache

エラーの内容

エラーでプロジェクトがつくれない状況はこうです。グローバルにインストールした覚えはないのですけど。

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

そう言い張るなら、したがいましょう。

npm uninstall -g create-react-app

up to date, audited 1 package in 179ms

found 0 vulnerabilities

改めてプロジェクトをつくろうとすると同じエラーです。原因は、前述のとおりキャッシュが残っているためでした。「それ、ドキュメントで早く言ってよ〜」。

[追記] これはNPXのバグのようです(「Why you should clear your NPX cache?」)。

NPX package will be stored in the cache forever. When NPX-utility was updated, the cache will not be updated. I'll repeat, it's a bug.

[参考]「[Solved] We no longer support global installation of Create React App

122
21
1

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
122
21