无法在流浪盒子上创建工作流星.js 项目 [英] Can't create working meteor.js project on a vagrant box

查看:15
本文介绍了无法在流浪盒子上创建工作流星.js 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在 Vagrant linux 机器(在 Mac 上运行)上启动新的 Meteor 应用程序.在 Mongo 中,它每次都会因未指定的未捕获异常"而失败.我已经尝试了很多方法来实现这一目标,但即使使用最简单的设置,我也无法让项目运行.如有任何建议,我将不胜感激.

I cannot start up a new Meteor application on a Vagrant linux box (running on a Mac). It fails every time with a 'unspecified uncaught exception' in Mongo. I have tried a bunch of things to get this going, but even with the simplest set-up, I cannot get the project running. I would be grateful for any suggestions.

我的步骤是:

  1. 创建一个完全干净的 Vagrant 盒子(ubuntu/trusty64");
  2. 在新盒子上安装 Meteor (curl https://install.meteor.com/| sh);
  3. 选择一个位置来创建项目;
  4. 创建一个新的 Meteor 项目(meteor create app);
  5. 启动项目(cd app;meteor)

我知道 vagrant 共享文件夹的权限很奇怪,因此对于上面的第 3 步,我尝试将项目放置:

I know that the permissions on the vagrant shared folder are quirky, so for step #3 above I have tried putting the project:

  1. 在共享的来宾/主机文件夹中,/vagrant,
  2. 在 Vagrant 主文件夹 (/home/vagrant) 的子目录中,
  3. / 的子目录中(权限设置为 vagrant:vagrant),以及
  4. /的子目录中,权限设置为root:root,使用sudometeor create app创建并使用sudo 流星
  1. in the shared guest/host folder, /vagrant,
  2. in a subdirectory of the Vagrant home folder (/home/vagrant),
  3. in a subdirectory of / (with permissions set to vagrant:vagrant), and
  4. in a subdirectory of / with permissions set to root:root, the project created with sudo meteor create app and run with sudo meteor

在所有情况下,我都会看到此错误:

In all cases, I see this error:

=> Started proxy.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start Mongo server.
MongoDB had an unspecified uncaught exception.
This can be caused by MongoDB being unable to write to a local database.
Check that you have permissions to write to .meteor/local. MongoDB does
not support filesystems like NFS that do not allow file locking.

我不知道这是 Vagrant 问题(尽管我认为不是,考虑到我的尝试)还是 Meteor 问题,但我怀疑它是 Meteor(或其众多依赖项之一).我怀疑这是一个权限问题,因为它在以 root 身份运行时失败了.我尝试从头开始构建meteor,但构建失败,我尝试使用 --release 0.9.0--release 0.9.2-rc1 创建项目并且下载被简单地杀死,没有解释.

I cannot tell if this is a Vagrant issue (though I think not, given what I've tried) or a Meteor issue, but I suspect it is Meteor (or one of its many dependencies). I doubt it is a permissions issue, since it failed when running as root. I've tried building meteor from scratch and the build fails and I've tried creating the project with --release 0.9.0 and --release 0.9.2-rc1 and the download is simply killed without explanation.

推荐答案

(1) 在第 2 步之后'在新盒子上安装 Meteor (curl https://install.meteor.com/ | sh)'

(1) After step 2 'install Meteor on the new box (curl https://install.meteor.com/ | sh)'

user$ cd /vagrant
user:/vagrant$ meteor create myApp

您应该在 Mac 主机上看到 myApp 文件夹(与 vagrantfile 相同的文件夹)

You should see the myApp folder on your Mac host (the same folder for the vagrantfile)

(2)在myApp文件夹里面,你会看到默认的.meteor文件夹,如果没有就创建一个名为local的文件夹

(2) Insides the myApp folder, you will see the default .meteor folder, make a folder called local if it is no there

user:/vagrant$ cd myApp/.meteor
user:/vagrant/myApp/.meteor$ mkdir local

(3)在/home/vagrant中创建相同的文件夹结构

(3) Create the same folder structure in the /home/vagrant

user:/vagrant/myApp/.meteor$ cd ~
~$mkdir -p myApp/.meteor/local

(4) 将/vagrant/myApp/.meteor/local 链接或挂载到/home/vagrant/myApp/.meteor/local

(4) Link or mount the /vagrant/myApp/.meteor/local to /home/vagrant/myApp/.meteor/local

sudo mount --bind /home/vagrant/myApp/.meteor/local/ /vagrant/myApp/.meteor/local/

或者永久使用

echo "sudo mount --bind /home/vagrant/myApp/.meteor/local/ /vagrant/myApp/.meteor/local/" >> ~/.bashrc && source ~/.bashrc

(5) 现在可以启动流星了

(5) Now you can start the meteor

~$cd /vagrant/myApp
user:/vagrant/myApp$meteor

我挂载本地文件夹而不是 <.meteor> 文件夹的原因是您仍然可以在 Mac 主机上编辑 <.meteor> 文件夹内的文件.您可以将 myApp 替换为您想要的任何名称

The reason why I mount the local folder rather than the <.meteor> folder is that you can still edit the files insides the <.meteor> folder on your Mac host. You can replace myApp with whatever name you want

希望对您有所帮助

这篇关于无法在流浪盒子上创建工作流星.js 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆