react-native 创建项目失败

xxxx-Pro:RectNative wyl$ react-native init Project
This will walk you through creating a new React Native project in /Users/xxx/Documents/RectNative/Project
Installing react-native...
Consider installing yarn to make this faster: https://yarnpkg.com
module.js:544
    throw err;
    ^

Error: Cannot find module '../lib/utils/unsupported.js'
    at Function.Module._resolveFilename (module.js:542:15)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
    at Object. (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
{ Error: Command failed: npm install --save --save-exact react-native
    at checkExecSyncError (child_process.js:574:11)
    at execSync (child_process.js:611:13)
    at run (/usr/local/lib/node_modules/react-native-cli/index.js:294:5)
    at createProject (/usr/local/lib/node_modules/react-native-cli/index.js:249:3)
    at init (/usr/local/lib/node_modules/react-native-cli/index.js:200:5)
    at Object. (/usr/local/lib/node_modules/react-native-cli/index.js:153:7)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 16296,
  stdout: null,
  stderr: null }
Command `npm install --save --save-exact react-native` failed.

解决办法:
从新安装一下yarn这个软件

你可能感兴趣的:(react-native 创建项目失败)