question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

running MongoDB with Forever

See original GitHub issue

I’m trying to run MongoDB with Forever. I can run mongo by itself with the following command: /usr/local/bin/mongodb-linux-x86_64-2.0.0/bin/mongod and it works great. But when I try to run with forever: forever start /usr/local/bin/mongodb-linux-x86_64-2.0.0/bin/mongo it doesn’t work. Here’s the error I see in the forever log:

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
SyntaxError: Unexpected token ILLEGAL
    at Module._compile (module.js:397:25)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at Array.<anonymous> (module.js:421:10)
    at EventEmitter._tickCallback (node.js:126:26)
warn: Forever detected script exited with code: 1

Any idea what I may be doing wrong?

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
huminadocommented, Jun 15, 2014

Workaround:

Create a shell script file and name it startmongod which contains the following:

#!/bin/bash

# not a good idea?: mongos --fork --logpath ~/mongoLogs/mongod.log
mongod --dbpath ~/data/db --logpath ~/mongoLogs/mongod.log

Now run mongo via forever by making the -c option /bin/bash, like this:

/usr/local/bin/forever start -c /bin/bash ./startmongod

0reactions
coltpinicommented, Dec 12, 2013

Still seeing this same issue. Any fix coming soon?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run Mongodb and Node using forever - Stack Overflow
Dont run mongo using forever,make it as a service. But in case of node server.js you can use forever.. When you start server...
Read more >
running MongoDB with Forever · Issue #148 - GitHub
I'm trying to run MongoDB with Forever. I can run mongo by itself with the following command: /usr/local/bin/mongodb-linux-x86_64-2.0.0/bin/ ...
Read more >
Manage mongod Processes — MongoDB Manual
Manage mongod Processes ... MongoDB runs as a standard program. You can start MongoDB from a command line by issuing the mongod command...
Read more >
What's the best way to keep mongodb running on a remote server ...
I have a node.js server running alongside MongoDB on an EC2 instance. What's the best way to make it run smoothly with Forever.js?...
Read more >
MongoDB Compass loading forever on start page - Super User
When I start MongoDB Compass 1.18, it loads forever and never starts. It displays the word "LOADING..." under a logo consisting of two...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found