通电从何处获取节点?

时间:2016-08-13 17:08:45

标签: meteor electron

当我使用“通电”和“通电包”时,从某处获取mongo和节点并将其打包到电气化的应用程序中。他们来自哪里?这些是来自流星的mongo和节点吗?或者安装在系统上的?上述命令是否都使用相同的mongo和节点?

1 个答案:

答案 0 :(得分:1)

** TL; DR:您的~/.meteor文件夹来自其中。

正在搜索GitHub Electrify repository,我们可以看到MongoDB路径和守护程序位置在this file中被引用为this.meteor.mongothis.meteor.mongod

this.meteor.mongo  = join(this.meteor.dev_bundle, 'mongodb', 'bin', 'mongo');
this.meteor.mongod = join(this.meteor.dev_bundle, 'mongodb', 'bin', 'mongod');

通过这些变量展开:

// https://github.com/arboleya/electrify/blob/94bb01d72d1cc0cc041836514de628d2c9009c23/lib/env.js#L114
this.meteor.dev_bundle     = join(this.meteor.tools, 'dev_bundle');

// https://github.com/arboleya/electrify/blob/94bb01d72d1cc0cc041836514de628d2c9009c23/lib/env.js#L113
this.meteor.tools          = this.meteor.root.replace(/meteor(\.bat)?$/m, '');

// https://github.com/arboleya/electrify/blob/94bb01d72d1cc0cc041836514de628d2c9009c23/lib/env.js#L112
this.meteor.root           = join(meteor_dir, meteor_symlink);

// https://github.com/arboleya/electrify/blob/94bb01d72d1cc0cc041836514de628d2c9009c23/lib/env.js#L109
meteor_symlink = fs.readlinkSync(join(meteor_dir, 'meteor'));

// https://github.com/arboleya/electrify/blob/94bb01d72d1cc0cc041836514de628d2c9009c23/lib/env.js#L108
meteor_dir    = join(this.os.home, '.meteor');

因此,我们可以看到,对于Linux,它将是:

  • meteor_dir:主路径(~),然后是子文件夹.meteor
    • 对我来说是~/.meteor;
  • meteor_symlink:遵循meteor的符号链接,
    • 对我来说,这链接到./packages/meteor-tool/1.3.5_1/mt-os.linux.x86_64/meteor;
  • meteor_root:以上的组合(例如~/.meteor/<symlink>),
    • 对我来说是~/.meteor/packages/meteor-tool/1.3.5_1/mt-os.linux.x86_64/meteor;
  • meteor_toolsmeteor_root,减去尾随&#34;流星&#34;,
    • 对我来说是~/.meteor/packages/meteor-tool/1.3.5_1/mt-os.linux.x86_64/;
  • meteor_dev_bundlemeteor_tools然后是子文件夹dev_bundle
    • 对我来说是~/.meteor/packages/meteor-tool/1.3.5_1/mt-os.linux.x86_64/dev_bundle;
  • this.meteor.mongometeor_dev_bundle然后是子文件夹mongo,然后是子文件夹bin,然后是子文件夹mongo
    • 对我来说是~/.meteor/packages/meteor-tool/1.3.5_1/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongo;
  • this.meteor.mongod:相当于this.meteor.mongo并附加d(即mongo变为mongod),
    • 对我来说是~/.meteor/packages/meteor-tool/1.3.5_1/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod