1

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

生成并运行node_modules目录和文件,但在打印“ npm 依赖图”后立即停止。package.jsonnpm install

输出的最后一行是rbenv: no such commandexec'`,这看起来很奇怪,因为这与 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'
4

1 回答 1

1

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

于 2015-03-27T02:30:42.817 回答