Global installation: npm i -g create-react-app
Analysis: The tar version is too low, and the tar version needs to be upgraded.
solve:
1. Execute the following command:
npm install -g tar
if still invalid
2. First confirm Node >= 14.0.0 and npm >= 5.6
3. Execute the following command
npx create-react-app create-react-app
...
npm install -g create-react-app
create-react-app my-app
Equivalent to
npx create-react-app my-app
This command will temporarily install create-react-app
the package. After the command is completed, create-react-app
it will be deleted and will not appear in the global. The next time you execute it, it will still be temporarily installed again.
expand:
npx is a command released after npm5.2
npx
It will automatically search for the executable file in the current dependent package, if it cannot find it, it will PATH
look for it.
If you still can't find it, it will install it for you