{"id":303,"date":"2015-11-07T22:07:37","date_gmt":"2015-11-07T14:07:37","guid":{"rendered":"http:\/\/weitaoc.com\/?p=303"},"modified":"2019-09-27T14:19:34","modified_gmt":"2019-09-27T06:19:34","slug":"react-native%e7%9a%84%e4%b8%a4%e7%a7%8d%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/weitaoc.com\/?p=303","title":{"rendered":"react-native\u7684\u4e24\u79cd\u5b89\u88c5\u65b9\u6cd5"},"content":{"rendered":"<p>react-native\u6709\u4e24\u79cd\u5b89\u88c5\u65b9\u6cd5\uff0c\u4e00\u79cd\u662f\u76f4\u63a5clone git\u7684\u4ee3\u7801\u8fdb\u884c\u7f16\u8bd1\uff0c\u53e6\u5916\u4e00\u79cd\u662f\u76f4\u63a5\u547d\u4ee4\u6253\u5305\u3002<\/p>\n<p>1.git clone<br \/>\n\u8fdb\u5165\u9700\u8981\u5b89\u88c5\u7684\u76ee\u5f55\u6267\u884c\u547d\u4ee4<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">git clone https:\/\/github.com\/facebook\/react-native.git<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u5b8c\u6210\u540e\u8fdb\u884c\u7f16\u8bd1<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">cd react-native &amp;amp;&amp;amp; npm install<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>2.npm\u65b9\u5f0f<br \/>\n\u8fdb\u5165\u9700\u8981\u5b89\u88c5\u7684\u76ee\u5f55\u6267\u884c\u547d\u4ee4<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">npm install -g react-native-cli<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u547d\u4ee4\u6267\u884c\u5b8c\u6210\u540e\uff0creact-native\u5b89\u88c5\u5b8c\u6bd5\uff0c\u5728\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u4e2d\u53ef\u80fd\u51fa\u73b0npm\u7684\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4e00\u4e0b\u4e24\u79cd\u65b9\u6cd5\u89e3\u51b3\uff1a<br \/>\na.\u5728\u5b89\u88c5\u76ee\u5f55\u6267\u884c\u6ce8\u518c\u547d\u4ee4\uff1a<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">npm config set registry http:\/\/registry.npmjs.org\/<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>b.\u547d\u4ee4\u884c\u524d\u52a0\u4e0a\u6743\u9650:<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">sudo npm install -g react-native-cli<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u521d\u59cb\u5316\u4e00\u4e2a\u9879\u76ee\uff1a<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">react-native init myTest<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u4e5f\u53ef\u4ee5\u5230example\u76ee\u5f55\u4e0b\u770b\u770b\u793a\u4f8b\u9879\u76ee\uff0c\u542f\u52a8\u793a\u4f8b\u7684\u65f6\u5019\u53ef\u80fd\u4f1a\u62a5\u9519\uff0c\u53ef\u80fd\u662fnpm\u6ca1\u542f\u52a8\uff0c\u5728react-native\u76ee\u5f55\u4e0b\u6267\u884c\uff1a<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">npm start<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u6b64\u65f6\u5e94\u8be5\u5c31\u80fd\u542f\u52a8\u6210\u529f\u4e86\u3002<\/p>\n<p>\u795d\u4f60\u987a\u5229\u5b8c\u6210\uff01\uff01\uff01<\/p>\n<p><a href=\"http:\/\/weitaoc.com\/archives\/303\/fb273ef29cf057a236290c437f325ef1\" rel=\"attachment wp-att-304\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-304\" src=\"http:\/\/weitaoc.com\/wp-content\/uploads\/2015\/11\/fb273ef29cf057a236290c437f325ef1.png\" alt=\"fb273ef29cf057a236290c437f325ef1\" width=\"250\" height=\"250\" \/><\/a><\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"http:\/\/weitaoc.com\">\u8ff7\u8def\u7684\u8001\u9f20<\/a> &raquo; <a href=\"http:\/\/weitaoc.com\/?p=303\">react-native\u7684\u4e24\u79cd\u5b89\u88c5\u65b9\u6cd5<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>react-native\u6709\u4e24\u79cd\u5b89\u88c5\u65b9\u6cd5\uff0c\u4e00\u79cd\u662f\u76f4\u63a5clone git\u7684\u4ee3\u7801\u8fdb\u884c\u7f16\u8bd1\uff0c\u53e6\u5916\u4e00\u79cd\u662f\u76f4\u63a5\u547d\u4ee4\u6253\u5305\u3002 1.git clone \u8fdb\u5165\u9700\u8981\u5b89\u88c5\u7684\u76ee\u5f55\u6267\u884c\u547d\u4ee4 1git clone https:\/\/github.com\/facebook\/react [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[49],"class_list":["post-303","post","type-post","status-publish","format-standard","hentry","category-other","tag-react"],"views":3248,"_links":{"self":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=303"}],"version-history":[{"count":5,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/303\/revisions"}],"predecessor-version":[{"id":312,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/303\/revisions\/312"}],"wp:attachment":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}