Questions tagged [node.js]

Node.js is an event based, asynchronous I/O framework that uses Google's V8 JavaScript engine. Node.js is commonly used for heavy client-server JavaScript applications. NOTE: Please read the Tag-Wiki before asking questions.

Node.js is an event based, asynchronous I/O framework that uses Google's V8 JavaScript Engine.

Node.js - or just Node as it's commonly called - is used for developing applications that make heavy use of the ability to run JavaScript both on the client, as well as on server side and therefore benefit from the re-usability of code and the lack of context switching.

It's also possible to use matured JavaScript frameworks like YUI and jQuery for server side DOM manipulation.

To ease the development of complex JavaScript further, Node.js supports the CommonJS standard that allows for modularized development and the distribution of software in packages via the Node Package Manager.

Applications that can be written using Node.js include, but are not limited to:

  • Static file servers
  • Web Application frameworks
  • Messaging middle ware
  • Servers for HTML5 multi player games

When asking questions about Node.js, you should:

  1. Make sure to check the official API Docs before asking, your question might be trivial.
  2. Isolate the problem and reproduce it with as little code as possible, if you can also use an online tool like JSApp for that, it's even better.
  3. If the question has nothing do with anything that's Node.js specific, please consider asking it as a question instead.
  4. Mention which version of Node.js you are running, when in doubt use node -v.
  5. Make sure to only use the Tag, since is ambigious.

Interesting Questions and Answers

Common Topics

Useful Links

Tutorials, Guides and Books

Talks and Presentations on Node.js

1026 questions
0
votes
0 answers

Seemly NodeJS restart | Docker vs PM2 vs Both?

I have a NodeJS application that wraps a large obfuscated JavaScript file and utilizes it to run computations. The issue is the JavaScript file has a memory leak, and required fairly frequent restart to clear the memory. Currently I am using a…
Nick W.
  • 167
  • 9
0
votes
1 answer

Lost Local Connection to MySQL DB that resides in AWS RDS

The MySQL DB residing in AWS RDS was made to connect with resources in the same VPC. I always had to make it publicly accessible in order to connect to it through MySQL Workbench 8.0 CE in Windows 11. The moment that I used mysql(2) NPM package to…
0
votes
0 answers

Apache Proxypass with SSL extremely slow

We have a server with the spec 8 vCore and 16GB RAM. At its peak, the server uses only 15 to 25% CPU and around 40% of RAM. The issue that we face is once the number of users start increasing, the response from apache simply starts taking more and…
nXn
  • 101
  • 2
0
votes
0 answers

access.log of Nginx filling up space (Ubuntu 22 Server)

Recently I have deployed my website using node.js server and using Nginx as reverse proxy, also nginx handles SSL, and forwards the HTTPS to HTTP server of node.js running at specific port. I am using UFW firewall and only allowed OpenSSH and Nginx…
0
votes
1 answer

How to configure Apache to handle two reverse proxies one one domain/server name?

I've got a node-react app on port 3000, and a node/express API running on port 3001 (localhost:3001/api). I need a reverse proxy setup in Apache that will put the React app on https://example.domain.com/ and the API on…
0
votes
0 answers

CosmosDB with private endpoint causes 'request originated from VNET through service endpoint' error?

I have a Node Js app which interacts with CosmosDB and which is deployed to a private AKS cluster. I was able to connect to Cosmos DB through a service endpoint in the Cluster VNET/subnet for Cosmos DB by enabling 'selected networks' in Cosmos DB. I…
floaty39
  • 1
  • 1
0
votes
0 answers

Node.js: Bad gateway on HTTPS server (unable to get the server's files?)

So, I have a Node.js server on render.com. It has only 2 files (server.js and index.html). But, when I load myservername.onrender.com/index.html, the request for file index.html fails and throws 502 Bad Gateway. server.js contains this: const http =…
0
votes
0 answers

Mixed content error nginx+docker container

I have an EC2 with Nginx setup & there are a few containers running inside. There's a Node JS gateway which is serving some of the requests in a webpage hosting in this Nginx server. Nginx is not a container - FYI. While we are able to load the…
serverstackqns
  • 764
  • 3
  • 16
  • 42
0
votes
0 answers

Docker container can't find express even though it is installed and the Dockerfile compiles fine

When I try to run a docker container from an image I just built using "docker run" Node.js can't find express even though it is installed and the Dockerfile compiles fine. Here is the output > dev > nodemon [nodemon] 2.0.22 [nodemon] to restart at…
Hassam Dauhoo
  • 11
  • 1
  • 3
0
votes
0 answers

PM2 Cluster Mode - All Clusters restarting on error

I am running a NodeJS application in Cluster mode: pm2 start server.js -i max Assume I have 2 clusters (0 and 1)... Our application is a simple NodeJS backend app running Express. However, there is the occasion where there is an unhandled error that…
0
votes
0 answers

NGINX waiting 60 seconds before processing request for NodeJS application

I have a NodeJS (ExpressJS) application containerized on Docker that is exposed through an NGINX reverse proxy also containerized on Docker. Sometimes, a request sent to NGINX takes 60 seconds before being sent to the application. In my monitoring…
mwryl
  • 101
0
votes
0 answers

Different port forwarding for https and wss (Websocket) using firewalld

Currently I setup port forwarding for a nodejs server such that all http requests (using tcp protocol) get redirected from port 80 to 3000, and all https requests (using tcp) get redirected from port 443 to 8080. The nodejs application also needs to…
VIVEK
  • 53
  • 1
  • 4
0
votes
0 answers

Why cant I get any kind of traffic from my AWS EC2 instance with a public IP?

Complete beginner to networking and im trying to deploy a simple express app on a windows instance of ec2 and I cannot find a single resource that explains the steps I need to take to make it happen without having a ton of technical terms and people…
Thugsy49
  • 1
  • 1
0
votes
0 answers

Linux / NodeJS get exitcode of process runned by "exec"

I need to run g++ compiled program and get exit status. My code in nodejs: import pty from "node-pty"; ... ptyProcess.write("exec /var/www/a.out\r\n'"); What I found: $! is the PID of the last process sent to the background $? is the exit code of…
EvaldasL
  • 1
  • 1
0
votes
0 answers

pm2 crash after this command pm2 restart all

I have a nodejs app sometimes I want to restart the app . but when I write "pm2 restart all" pm2 crached and pm2's list is removed. also I've written a cron-start into pm2 beacuse the app will slow after a few hours and server's memory is full,…