命令行npm install -g react-native-cli
rn的架构图:
C:\MyApp\node-v10.16.3-win-x64\node_modules\react-native-cli
这个index.js里有很多有用的信息,当遇到react native的各种错误时,搞清楚他们的原理有助于问题定位:
rn需要的依赖库:
'use strict';
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
var execSync = require('child_process').execSync;
var chalk = require('chalk');
var prompt = require('prompt');
var semver = require('semver');
// Use Yarn if available, it's much faster than the npm client.
// Return the version of yarn installed on the system, null if yarn is not available.
function getYarnVersionIfAvailable() {
要获取更多Jerry的原创文章,请关注公众号"汪子熙":