【问题标题】:MongoDB on Ubuntu weird error ^?ELF^B^A^AUbuntu上的MongoDB奇怪错误^?ELF^B^A^A
【发布时间】:2015-11-09 10:23:08
【问题描述】:

我在 Ubuntu 服务器上成功运行了 MongoDB 以及我的 nodeJS 应用程序。但是由于某种原因,当我使用 forever start /path/to/mongod 启动它时,我的 mongodb-log 中出现以下错误:

/mongodb/mongodb-linux-x86_64-3.0.5/bin/mongod:1
(function (exports, require, module, __filename, __dirname) { ^?ELF^B^A^A^

SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
error: Forever detected script exited with code: 8

我删除了 mongodb 目录并重新安装它,但我仍然得到同样的错误。

感谢您的帮助

【问题讨论】:

    标签: mongodb ubuntu forever


    【解决方案1】:

    forever 仅适用于基于 node.js 的模块。 mongod 是二进制文件(即 ELF 格式,请使用 file $(which mongod) 自行验证),forever 无法处理。

    您看到的是 forever 试图使用 node 启动一个名为 mongo 的 node 模块并且无法编译 js 代码(因为它正在读取 ELF 标头)。

    您将不得不依赖系统的 init 系统作为常规守护程序。我会start reading here 了解如何继续。

    【讨论】:

    • 这是有道理的,因为单独运行 mongod 可以正常工作,谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-13
    • 1970-01-01
    • 2021-11-28
    • 2014-03-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多