When the latest React is 5.0.0, I encountered an error when I needed to install an older version of React (4.0.3).
npx create-react-app@4.0.3 app-name
> You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).
> We no longer support global installation of Create React App.
It was written that npx clear-npx-cache
would solve the problem, but it did not.
However, I was able to install it normally with the following method.
npx create-react-app app-name --scripts-version 4.0.3
最新のReactが5.0.0の時に、古いバージョンのReact(4.0.3)をインストールする必要が出てきて、エラーに遭遇。
npx create-react-app@4.0.3 app-name
> You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).
> We no longer support global installation of Create React App.
npx clear-npx-cache
で解決するとか書かれてたけど解決せず。
でも、次の方法で普通にインストールできた。
npx create-react-app app-name --scripts-version 4.0.3