美文网首页
react 脚手架 初始化项目

react 脚手架 初始化项目

作者: 梁庄十年 | 来源:发表于2020-02-19 11:24 被阅读0次
  • 全局安装 yarn(Yarn是facebook发布的一款取代npm的包管理工具)
npm i yarn -g
  • 查看版本号
yarn -v
  • 全局安装react脚手架
yarn add create-react-app -g
  • 在命令行中使用初始化命令,初始化一个项目;
create-react-app 项目名称
// 或
npx create-react-app 项目名称

如果上述方法失败,出现"Incorrect integrity when fetching from the cache" ,可以使用 yarn cache clean 解决,完成之后 在重新执行 初始化命令

关于npx相关的文章可以参考阮一峰教程http://www.ruanyifeng.com/blog/2019/02/npx.html

相关文章

网友评论

      本文标题:react 脚手架 初始化项目

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