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
1 answer

How to create folders and files with ' and / in Linux (node)

In the system I developed for the company where I work we have a kind of file drive. However, an old rule that I put is the prohibition of / and ' in the name of folders and files because of the rules of naming folders and files in Linux. However I…
0
votes
1 answer

Nginx + Socket.io websocket closed before establishing connection issue

Hi i am running an express server with a socket.io server attached to it const { Server } = require("socket.io"); var server = http.createServer(app); /** * Adding Socket io implementation */ const io = new Server(server, { cors: { origin:…
0
votes
0 answers

Pm2 unable to access SSL cert and Key files even though I have permission to access those files

When I deployed my mern app on our server it throwed me a EAccess error saying unable to access my cert and key files of ssl however then I created a group for me and my root with adequate permissions so that my node server can access those files…
0
votes
1 answer

Configure two application in same server in Nginx on two ports

I have two different applications. Survey application built with express framework Django application using rest api and react I would like to achieve: vardhan.com/survey, vardhan.com/feedback, etc on survey application and vardhan.com/ and…
0
votes
1 answer

Ubuntu 20.04 VM Corrupted Javascript files when installing NPM packages

I'm experiencing something weird on Ubuntu server 20.04, Its virtual machine running on XCP-NG 8. I tried several versions of nodejs 14, 16, 18 but nothing solves the issue I can't even install nodejs through APT the only way that worked was through…
Xsmael
  • 171
  • 1
  • 10
0
votes
1 answer

Apac2 + Cloudflare 502 Error On Static Files

I try to setup my nodejs application on ubuntu 16. I configure apach2 like that; I'm getting Error 502:Bad gateway from cloudflare. I did not do any config on cloudflare. What should ı do? Server is running because I can go this url;…
0
votes
0 answers

connect() failed (111: Connection refused) while connecting to upstream Nginx

I'm working on the deployment of the app with the backend and frontend using Nginx as a proxy. However I'm facing the 502 Bad Gateway, the error says [error]: connect() failed (111: Connection refused) while connecting to upstream, client:…
frankiie
  • 101
  • 1
0
votes
0 answers

public folder was lock while running node project

I am working on node 14.x version at ubuntu 18.04 os while running the project I tried to upload an object the root user locked the public folder after that I was unable to use the object that I uploaded. if I want to use that object I want to…
0
votes
1 answer

Cloud-init / cloud-config to install node.js

From reading the cloud-init docs (https://cloudinit.readthedocs.io/en/latest/topics/modules.html#apt-configure), it appears that this user-data should add the Nodesource source and key for apt, and install Node v18: apt: sources: nodejs: …
Doug Reeder
  • 101
  • 2
0
votes
0 answers

Nginx configuration with NodeJS application on Ubuntu 20.04

I've been attempting to configure a backend NodeJS server (ExpressJS) to use with Nginx, but there have been some difficulties. I am currently running a DigitalOcean droplet with Ubuntu 20.04 installed. Here's what I've done: Installed and…
0
votes
1 answer

PM2 cluster mode additional processes use wrong script path

I have a nodejs app running on a server with the following ecosystem.config.js: module.exports = { apps : [ { name : "app.website.com", script : "/var/www/app.website.com/node/server.js", cwd :…
jdog
  • 121
  • 7
  • 29
0
votes
1 answer

`nohup: failed to run command 'node': No such file or directory` when running script through ssh

I have a remote server in which I serve a webserver using node (express) and nginx. I have a ./devops/deploy.sh script which starts the webserver and restarts nginx. Said script works correctly if I manually connect to the instance (ssh @)…
ffigari
  • 103
  • 1
  • 4
0
votes
1 answer

Does Azure web app support out of the box managed clustering and mulit-region failover for node.js?

I have read through as much documentation as I can find, and I cant see an answer to this. MS say hosting of node.js is possible, but they don't seem to say what options, if any, there are for clustering and multi-region failover. here I am…
eos
  • 551
  • 4
  • 10
  • 27
0
votes
0 answers

When calling script from jenkins it is not working as expected

we have one react application and start it using pm2 with pm2 start manually. We have written one script to run it, it is working as expected when we run script manually on server. But when calling from jenkins it is not working as expected. Below…
Satish Lamak
  • 51
  • 1
  • 3
  • 7
0
votes
1 answer

How do you make nodejs server

This is some of the code in nodejs. const app = express(); const server = app.listen(3000); app.use(express.static("public")); console.log("Server is running"); const io = socket(server); It works on local host. What do you have to do for anyone…
Leo
  • 1