美文网首页
配置 react native 环境

配置 react native 环境

作者: A_1341 | 来源:发表于2018-06-27 01:01 被阅读0次
  1. 使用 node 8 lts 版本
  2. npm 使用 v4. v5 版本不兼容
//拷贝全局 node_modules 中的 npm , 在新文件夹 bin 中执行
node npm-cli.js install npm@4.6.1 -g //在全局重新安装npm v4
  1. 设置淘宝源
npm config set registry  "https://registry.npm.taobao.org"
npm cache clear //如报错需要清除npm缓存
  1. 安装yarn, 不然会报错
npm install yarn -g
  1. 安装 create-react-native-app
npm install create-react-native-app -g 
  1. 初始化项目
create-react-native-app project-name
  1. 安装 exp 用于公网实机测试
npm install exp -g
  1. 进去项目文件夹 exp 发布测试项目
exp publish

相关文章

网友评论

      本文标题:配置 react native 环境

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