报错如下:
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\wx\AppData\Roaming\npm-cache\_logs\2020-02-19T07_36_12_091Z-debug.log
折腾了好久后,查到了错误原因:
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.
翻译如下:
未提供模板。这可能是因为您正在使用过时的create react app版本。
请注意,不再支持create react app的全局安装。
解决方法:
1、首先在命令行里把过时的create-react-app删除,使用命令
np

在尝试创建react项目时,只看到node_modules和package.json,启动报错。问题源于使用了过时的create react app。解决方法包括:删除旧版本,全局安装最新create-react-app,然后按照提示使用yarn进行项目管理。
最低0.47元/天 解锁文章
2237

被折叠的 条评论
为什么被折叠?



