If you’ve previously installed
create-react-app
globally vianpm install -g create-react-app
, we recommend you uninstall the package usingnpm uninstall -g create-react-app
to ensure thatnpx
always uses the latest version.
Use either one of the below commands:
npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app
if npm uninstall -g create-react-app
stated above does not work.
Type which create-react-app
to know where it is installed. Mine was installed in /usr/bin
folder. Then do sudo rm -rf /usr/bin/create-react-app
. (Credit to @v42 comment below)