react native命令行全局安装

命令行npm install -g react-native-cli

react native命令行全局安装_第1张图片

rn的架构图:

react native命令行全局安装_第2张图片

C:\MyApp\node-v10.16.3-win-x64\node_modules\react-native-cli

这个index.js里有很多有用的信息,当遇到react native的各种错误时,搞清楚他们的原理有助于问题定位:

react native命令行全局安装_第3张图片

rn需要的依赖库:

react native命令行全局安装_第4张图片
'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的原创文章,请关注公众号"汪子熙":

你可能感兴趣的:(JavaScript)