1
0

More than 1 year has passed since last update.

【React】create-react-appで出たエラーの対処法

Posted at

はじめに

普段はVue.jsを使っているのですが、React.jsの学習をしようと思い、create-react-appでプロジェクトを作ろうとしたときに出たエラーの対処法について、備忘録も兼ねて残しておきます。

エラー内容

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

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/

create-react-appを実行したときにバージョンがアップされました。
そのバージョンを用いて、プロジェクトを作ろうとすると、使用しているバージョンが古いからダメだと怒られました。

バージョンアップしたのに、バージョンが古いって、、はにゃ、、、?って感じですね。笑

それにグローバル環境にインストールした覚えもないです。

原因と解決方法

バージョンをアップデートしてもまだ古いバージョンのキャッシュが残っているのが原因のようなので、npxのキャッシュを削除することで解決できました。

npx clear-npx-cache
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