If you’ve previously installed
create-react-appglobally vianpm install -g create-react-app, we recommend you uninstall the package usingnpm uninstall -g create-react-appto ensure thatnpxalways uses the latest version.
Docs
Use either one of the below commands:
npx create-react-app my-appnpm init react-app my-appyarn 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)