I am getting events.js:136 throw er; Unhandled 'error' event don't know how and why? i have reinstalled the nodejs and mongodb as well but throwing same error.
package.json
{
"name": "bookstore",
"version": "1.0.0",
"description": "simple bookstore app",
"main": "app.js",
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"express": "*",
"body-parser": "*",
"mongoose": "*"
},
"author": "AveesP",
"license": "ISC"
}
App.js code
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
//connect to mongoose
mongoose.connect('mongodb://localhost/bookstore');
var db = mongoose.connection;
app.get('/', function(req, res) {
res.send('Hello world!');
});
app.listen(3000);
console.log('Running on port 3000...');

Try to use the following commands to enlarge the number of handlers that actives the watcher (listener of application changes)
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p --system
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With