First Heroku deploy failed `error code=H10`

Found solution for me here: Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch) In my case my app crashed because I was hard setting the PORT, instead of using the port that heroku dinamicaly sets, which can be accessed with process.env.PORT

Why am I getting “Error socket hang up” response?

I recently got this socket hang up problem. I researched for a few days until I found a solution that worked for me. So, maybe this can help. It worked for me to add the http(s)Agent property with keepAlive: true in creating the http client. Here’s an example of what it might look like: This property is responsible for managing the … Read more

stop all instances of node.js server

Windows Machine: Need to kill a Node.js server, and you don’t have any other Node processes running, you can tell your machine to kill all processes named node.exe. That would look like this: And if the processes still persist, you can force the processes to terminate by adding the /f flag: If you need more fine-grained control and … Read more

NodeJS / Express: what is “app.use”?

The app object is instantiated on creation of the Express server. It has a middleware stack that can be customized in app.configure()(this is now deprecated in version 4.x). To setup your middleware, you can invoke app.use(<specific_middleware_layer_here>) for every middleware layer that you want to add (it can be generic to all paths, or triggered only on specific path(s) your server handles), … Read more

Significance of port 3000 in Express apps

3000 is a somewhat arbitrary port number chosen because it allows you to experiment with express without root access (elevated privilege). Ports 80 and 443 are the default HTTP and HTTPS ports but they require elevated privilege in most environments. Using port 3000 in examples also helps indirectly emphasize that you ideally want to put your express app behind nginx or Apache httpd or … Read more

SyntaxError: Unexpected token import – Express

NodeJS supports import natively only experimentally, and only if your script has the .mjs extension. That’s why the start in your package.json is referring to babel-node, which transpiles ES6 code into classic JS on-the-fly before running it. But I doubt even that command will work, because you’re not passing any presets to babel to run the script. Try this command: nodemon … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)