美文网首页
npx create-react-app报错

npx create-react-app报错

作者: ahalshai | 来源:发表于2020-10-11 22:05 被阅读0次

使用npx创建react脚手架应用,使用命令

npx create-react-app 项目名
image.png

从图片看是验证失败了,可以看出是从淘宝镜像源获取的,可是我不禁想起我npm并没有使用淘宝源啊,仔细看发现报错的内容是yarn命令。

所以npx create-react-app 实际使用了yarn!!!

参见https://stackoverflow.com/questions/63266392/does-npx-uses-yarn
所以解决方案很简单

yarn config set registry https://registry.npmjs.org/

yarn改回默认源

相关文章

网友评论

      本文标题:npx create-react-app报错

      本文链接:https://www.haomeiwen.com/subject/errypktx.html