React Native init不会创建Xcode项目

时间:2015-03-27 01:38:58

标签: xcode reactjs react-native

当我运行react-native init application-name时,不会生成任何XCode项目。

生成node_modules dir和package.json文件并运行npm install,但在打印'npm依赖图'后立即停止。

输出的最后一行是rbenv: no such command exec',这看起来很奇怪,因为它与rbenv / Ruby无关。

完整日志输出:

 react-native init ReactiveNews
This will walk you through creating a new React Native project in /Users/taylor/Git/ReactiveNews
npm WARN engine makeerror@1.0.10: wanted: {"node":"0.6.x"} (current: {"node":"0.10.38","npm":"1.4.28"})

> ws@0.4.31 install /Users/taylor/Git/ReactiveNews/node_modules/react-native/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node: Finished
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished
npm WARN engine tmpl@1.0.3: wanted: {"node":"0.6.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
react-native@0.2.1 node_modules/react-native
├── absolute-path@0.0.0
├── stacktrace-parser@0.1.1
├── react-timer-mixin@0.13.1
├── underscore@1.7.0
├── q@1.0.1
├── yargs@1.3.2
├── debug@2.1.3 (ms@0.7.0)
├── source-map@0.1.31 (amdefine@0.1.0)
├── optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
├── worker-farm@1.1.0 (xtend@4.0.0, errno@0.1.2)
├── rebound@0.0.12
├── sane@1.0.1 (watch@0.10.0, fb-watchman@0.0.0, minimatch@0.2.14, walker@1.0.6)
├── uglify-js@2.4.17 (uglify-to-browserify@1.0.2, async@0.2.10, yargs@1.3.3, source-map@0.1.34)
├── jstransform@10.0.1 (base62@0.1.1, esprima-fb@13001.1.0-dev-harmony-fb)
├── joi@5.1.0 (topo@1.0.2, isemail@1.1.1, hoek@2.12.0, moment@2.9.0)
├── connect@2.8.3 (uid2@0.0.2, methods@0.0.1, fresh@0.1.0, pause@0.0.1, cookie-signature@1.0.1, buffer-crc32@0.2.1, qs@0.6.5, bytes@0.2.0, cookie@0.1.0, formidable@1.0.14, send@0.1.2)
├── module-deps@3.5.6 (inherits@2.0.1, shallow-copy@0.0.1, minimist@0.2.0, subarg@0.0.1, stream-combiner2@1.0.2, parents@1.0.1, readable-stream@1.0.33, resolve@0.7.4, through2@0.4.2, duplexer2@0.0.2, concat-stream@1.4.7, browser-resolve@1.8.1, JSONStream@0.7.4, detective@3.1.0)
├── react-tools@0.13.0-rc2 (commoner@0.10.1)
└── ws@0.4.31 (tinycolor@0.0.1, options@0.0.6, commander@0.6.1, nan@0.3.2)
rbenv: no such command `exec'

1 个答案:

答案 0 :(得分:1)

问题出在node_modules / react-native下的init.sh脚本中,每次执行时rbenv都会抛出rbenv: no such command `exec'。我首先使用rbenv exec通过rbenv直接运行它来解决它,但是能够通过关闭rbenv bundler插件来完全解决问题。