我正在尝试让一个项目在Linux上运行。通常我们是在macOS上开发的,我以为Linux上的设置非常相似。
我在计算机上获取应用程序的步骤如下:
通过shell脚本执行根据网站安装的nodejs
通过shell脚本执行根据网站安装的Meteor
git checkout [应用程序的git URL]
cd eaab(eaab =应用程序名称)
npm安装
mrt安装
npm运行开始
package.json包含多个运行脚本,被调用的启动脚本定义如下:
"scripts": {
"start": "meteor --settings settings/development.json",
[removed other scripts not relevant right now]
},
尽管所有这些都可以在macOS上运行,但在Linux上却会失败,如下所示:
skaupp@developers:~/Workspace/meteor/eaab
>npm run start (git)-[master]
> eaab@1.0.0 start /home/skaupp/Workspace/meteor/eaab
> meteor --settings settings/development.json
[[[[[ ~/Workspace/meteor/eaab ]]]]]
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn /usr/lib/node_modules/meteor/mongodb/bin/mongod ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! eaab@1.0.0 start: `meteor --settings settings/development.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the eaab@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/skaupp/.npm/_logs/2018-04-05T09_43_23_575Z-debug.log
我认为通常在一般的Meteor安装过程中或在运行mrt install时都将安装mongodb,但事实并非如此。我可能必须手动安装它,或者更改设置环境的方式。无论哪种情况,我都知道,除了mongodb之外,Meteor所需的其他工具可能不会自动设置。
我该如何解决这个问题,换句话说,我想念什么?
最佳答案
流星的安装非常简单而且非常直接。您只能在Linux环境中运行命令curl https://install.meteor.com/ | sh
。而已。流星有自己的Node.js和MongoDB软件包,它们是自动安装的。默认情况下,Meteor将使用这些软件包,而不是单独安装的软件包。我建议您检查官方的Meteor Guide,因为它非常实用且内容丰富。