I wanted to create a new react app using the create-react-app
script. I still had a global version installed which is not supported anymore so I uninstalled the global version and tried creating a new one like this:
npx create-react-app myapp
I then got an error of no template used and that I probably use an older version of create-react-app. I read online and this DID work:
npx --ignore-existing create-react-app myapp
I read that it means I still got an older version even though I did uninstall the global version. So how do I remover any other older version of create-react-app?
The npx
is a tool to execute packages and npm
is a tool mainly used to install packages. That's means if you want to execute a package without installing it on your computer and then launch it you can use npx
directly.
Uninstall the library globally
Use npm uninstall -g create-react-app
then check if is it removed successfully from your machine using which create-react-app
. If still exist delete it manually.
Linux
rm -rf /usr/local/bin/create-react-app
Windows
del /f/s/q C:\nodejs\node_modules\npm\bin\create-react-app > nul
rmdir /s/q C:\nodejs\node_modules\npm\bin\create-react-app
Finally you able to use the last version with npx create-react-app myapp
.