无法在无业游民的盒子上创建有效的meteor.js项目 [英] Can't create working meteor.js project on a vagrant box

查看:60
本文介绍了无法在无业游民的盒子上创建有效的meteor.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. 在新包装盒(curl https://install.meteor.com/ | sh)上安装Meteor;
  3. 选择一个位置来创建项目;
  4. 创建一个新的Meteor项目(meteor create app);
  5. 启动项目(cd app; meteor)
  1. create a completely clean Vagrant box ("ubuntu/trusty64");
  2. install Meteor on the new box (curl https://install.meteor.com/ | sh);
  3. choose a location to create the project;
  4. create a new Meteor project (meteor create app);
  5. start up the project (cd app; meteor)

我知道对无业游民的共享文件夹的权限很古怪,因此对于上面的第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/子目录中,该项目使用sudo meteor create app创建并使用sudo meteor
  5. 运行
  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.

我无法确定这是流浪者问题(尽管我尝试过,但我认为不是)还是流星问题,但我怀疑这是流星(或其众多依赖项之一).我怀疑这是一个权限问题,因为以root身份运行时失败.我尝试从头开始构建流星,并且构建失败,并且尝试使用--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

希望获得帮助

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

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