当我create-react-app my-app
在终端中键入命令时,它似乎可以正常工作-成功下载所有库,等等。但是在该过程结束时,我收到一条消息,提示您输入template was not provided
。
输入值
user@users-MacBook-Pro-2 Desktop% create-react-app my-app
输出量
Creating a new React app in /Users/user/Desktop/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
..... nothing out of the ordinary here .....
✨ Done in 27.28s.
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.
在的package.json中my-app
:
"dependencies": {
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.0" <-- up-to-date
}
我检查了CRA 更改日志,它看起来像添加了对自定义模板的支持-但是看起来命令create-react-app my-app
似乎没有更改。
知道这里发生了什么吗?
尝试以管理员身份运行终端。我遇到了同样的问题,除了以管理员身份打开终端,然后执行npx create-react-app yourAppName之外,没有任何帮助