描述:
想要用脚手架快速新建一个react app的时候使用 npx create-react-app project
命令后查看文件夹,文件夹下只有 node_modules, package.json and packageloack.json
三个项目,其他如 src, public and scripts folder
都没有。
命令行报错如下:
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
解决:
先执行 npm rm -g create-react-app
然后重新npx create-react-app project
即可。
参考链接