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.

Mern throws error, crashes, immediately after starting server

See original GitHub issue

mern start, then:

> mern-starter@1.0.0 start /Users/me/MernTest
> cross-env NODE_ENV=development node index.js

MERN is running on port: 8000! Build something amazing!

/Users/me/MernTest/node_modules/mongodb/lib/server.js:236
        process.nextTick(function() { throw err; })
                                      ^
Error: connect ECONNREFUSED 127.0.0.1:27017
    at Object.exports._errnoException (util.js:870:11)
    at exports._exceptionWithHostPort (util.js:893:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1062:14)

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.3.1
npm ERR! nom  v3.7.2
npm ERR! code ELIFECYCLE
npm ERR! mern-starter@1.0.0 start: `cross-env NODE_ENV=development node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mern-starter@1.0.0 start script 'cross-env NODE_ENV=development node index.js'.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ghoshnirmalyacommented, Feb 18, 2016

First, you will have to install and run mongoDB. Follow the following steps:

  1. brew update
  2. brew install mongodb
  3. brew install mongodb --with-openssl
  4. brew install mongodb --devel
  5. sudo mkdir -p /data/db
  6. sudo chown -R <username> /data/db (Replace <username> with your username which you can get by typing whoami in the terminal)
  7. mongod

Got to localhost:8000.

0reactions
Sammy0807commented, Jan 18, 2018

After the mern blog appears the first time, once I refresh the page, I get a typeError: cannot read property ‘map’ of undefined On client/modules/post/components/postlist.js 10:9

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does my app keep crashing through a faulty error handler ...
Yeah and inside the Server the Error Handling middleware should be the last middleware, and it should be after the authController as well....
Read more >
MERN Stack Tutorial #13 - Handling Error Responses
Get the full course now (without ads) on the Net Ninja Pro site:https://netninja.dev/p/ mern -stack-tutorial Get access to all free ...
Read more >
Causes of Heroku H10-App Crashed Error And ... - YouTube
This video is focused on the Heroku H10-App crashed error code which is thrown when an application crashes on Heroku.
Read more >
Best Practices for Node.js Error-handling - Toptal
The best way to deal with these errors is to crash immediately and restart gracefully with an automatic restarter like PM2—the reason being...
Read more >
Causes of Heroku H10-App Crashed ... - DEV Community ‍ ‍
This error is thrown in a Node.js environment if you forget to set a start script . Heroku uses this script to start...
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