Questions tagged [node.js]

Node.js is an event-based, non-blocking, asynchronous I/O runtime that uses Google's V8 JavaScript engine and libuv library. It is used for developing applications that make heavy use of the ability to run JavaScript both on the client as well as on the server side and therefore benefit from the re-usability of code and the lack of context switching.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Having 2 open connections to 2 separate Redis Instances on Nestjs Websocket server giving Connection Error

I've been tinkering around with this chat app project I started a bit back and am running into a little trouble with connecting to 2 separate Redis instances. Note, if this is dumb and not a good move,...
Dylan Steele's user avatar
0 votes
0 answers
11 views

not able to run sendEmail.js in nodejs, using nodemailer (Error- Configuration property "EMAIL_SMTP" is not defined) -

i am trying to send mail using nodemailer and tried differnt hosts services but encountering this error WARNING: No configurations found in configuration directory:/home/ayeen/manage/proj-ang/server/...
Student mern's user avatar
0 votes
0 answers
11 views

Storing the cookies in Express js

I deploy the frontend and backend on a different server and I made in a function of login that the token will be stored in the cookie so when I login with frontend the token does not be stored but ...
Mohamed Helmy's user avatar
0 votes
1 answer
22 views

NodeJs asynchronous error handler controller. Why does original function need to be wrapped by another function?

module.exports = catchAsync = (fn) => { return (req, res, next) => { fn(req, res, next).catch((err) => { next(err); }); }; }; I'm confused on why fn.(req,res,next).catch(...
Haroon Almadani's user avatar
0 votes
0 answers
34 views

How to verify a Firebase ID token using jose in node?

I'm trying to verify a JWT (session cookie) following the instructions here guided by this sample implementation in Python using the jose package (although I'm open to other node packages). Why? I'm ...
Ben's user avatar
  • 20.5k
0 votes
0 answers
17 views

Retrieving data to an array returns empty [duplicate]

I created a simple application using Node, React and Mongo. When I try to retrieve the data from Mongo, the array to which I'm trying to populate the data returns an empty array. Adding Data works ...
thegaffoor's user avatar
0 votes
1 answer
16 views

Vercel backend node 21.4.0 deployment CORS ISSUES

I deployed an express backend on Vercel to make easier the developpement of my app. My problem is CORS issues with my backend on Vercel. I have no corse issue when I use the backend local URL. The ...
Poumon's user avatar
  • 3
0 votes
0 answers
4 views

Can't serve website due to _BundleGraph.default assertion error

I have almost zero background in Node.js, and I was trying to serve locally a website via the command: parcel serve index.html --port 3001 However, I get the following error: 🚨 Build failed. Error: ...
Tommaso Bendinelli's user avatar
0 votes
0 answers
7 views

Document Versioning for Event-Based Microservices Application

I am developing a microservices application with NATS Streaming. I am tackling concurrency issues by adding a version property to my database documents and incrementing them by one every time they are ...
user15344186's user avatar
0 votes
2 answers
20 views

How to redirect user logout after destroy cookie with response.setHeader() in node.js

I've a user login system on node.js. When a user is logged in, I set a cookie to maintain the user session. When the user is logged out, I destroyed the cookie with the code below: function userLogout(...
ket's user avatar
  • 955
0 votes
0 answers
8 views

Nodejs event emitter implementation in Nextjs 13 or 14

How do i make nodejs event emitter object listen to emitted events globally within my nextjs13 application just like in normal nodejs environment? I have a file post.js where a user creates a new post....
kelvin torver's user avatar
-1 votes
0 answers
9 views

Jest debugging in nodejs is not starting

I have a problem debugging jest test in Nodejs. I have debugger configuration "version": "1.0.0", "configurations": [ { "type": "node", ...
P.K.'s user avatar
  • 1,752
0 votes
1 answer
14 views

Passport authentication showing unauthorized in node.js after registering the data successfully in my database?

I have made a register route with a docSchema registration using the register function of the class. Now the problem is that upon registering on the frontend it does not throw any error but rather ...
Aman Tyagi's user avatar
-1 votes
1 answer
33 views

NODE_ENV='production' doesnt not log the errors from the global error handler middleware

For the exact code format, errors are logged and sent back to the client(Postman) in development mode. But not sent back to the client in production mode. This is the code for the global error handler ...
Sik 2's user avatar
  • 19
0 votes
0 answers
19 views

How can I use pnpm within my electron application?

I'm wanting to use pnpm instead of the tradition npm or yarn to decrease the possibility of installing duplicate modules in my node_modules, as well as to reduce the size of the node_modules, but ...
JediSZN's user avatar
  • 79
0 votes
1 answer
58 views

Node fs.unlink does not delete the files immediately

I have an issue with node fs.unlink I have a function that writes files to disk storage extracts data from the these files then deletes the files const parseShpFile = async ({ cpgFile, dbfFile,...
Ahmed Gaafer's user avatar
  • 1,623
-3 votes
1 answer
29 views

ReferenceError: document is not defined(javascript) [duplicate]

enter image description hereWhy after installing node.js, an error like that occurs after I run the code of various javascript commands, it seems it's not because the code is an error but because node....
Muhammad Septiyan140905's user avatar
0 votes
0 answers
31 views

MongoDB documents are randomly deleted after a few hours

I own a vps. There we have three minecraft servers and one discord bot. we also have a local mongoDB running on the vps. I have connected to it using node.js mongoose library. I am talking about the ...
Lapirate's user avatar
0 votes
0 answers
17 views

Alma Linux 8 cant connect my react app with nodejs server

My react app is running on apache2 and is placed inside cPanel's directory public_html. My backend nodejs server is also inside the same public_html directory but its running on linux, My frontend ...
Bilal Ahmed's user avatar
0 votes
0 answers
10 views

How to send data from Adonis js API to fabric-sample ledger of Hyperledger fabric?

I am trying to send data from my Adonis js application to fabric-sample ledger but getting below error, i am not able to make connection between these two technologies. ERROR: [18:08:05.471] ERROR (...
Archit's user avatar
  • 1
1 vote
1 answer
21 views

Custom validation in Joi is not returning error message

I was trying to make the email unique using Joi validation by making custom validation function checking if it exists in the database and even though the console.log(user); is working, I'm not ...
Abdulrahman's user avatar
0 votes
0 answers
20 views

how to connect my node project to MongoDb?

i try to connect my node project to mongoDb using this url. "mongodb+srv::@cluster0.herrxnf.mongodb.net/?retryWrites=true&w=majority of course, i provided user and password. but it shows an ...
kururu's user avatar
  • 63
0 votes
2 answers
25 views

Console not showing "Server Start" after node app.js with Express

I didn't get start server : 3001 message on console when I bush node app.js on terminal. My app.js file content: var createError = require('http-errors'); var express = require('express'); var path = ...
Ali Almahoozi's user avatar
-1 votes
0 answers
19 views

Unable to see the cookies in frontend but visible in postman

I am setting the cookie using "res . cookie ("token": token)" in backend code running in localhost:5000. I am able to see the cookies in postman, but not on browser tools after ...
Jayanth Karnati's user avatar
0 votes
0 answers
9 views

Proxy requests to nginx web application through Express Server: Issues

I have quite a big question to ask about Nginx and Express Server to get some help, I am going to split it into three parts to make it easier to understand and get help. 1. Nginx Application This ...
Braydan's user avatar
  • 25
0 votes
0 answers
16 views

Peach Payment Getaway - Authentication Token Issue

I'm currently encountering difficulties obtaining an authentication token through the provided endpoint Here are the details of the issue: Endpoint for Authentication Token: https://testsecure....
teenage vampire's user avatar
-1 votes
2 answers
39 views

Issue with running Prettier: exit code 2 and unexpected token ':'

Each time I try to commit or run yarn format (using this script : "format": "prettier --config \"packages/**/*.{ts,tsx}\"") or run make fmt, I got the following error ...
Dorra Kahlaa's user avatar
-3 votes
1 answer
40 views

node index.js is not running in terminal [closed]

Screenshot of my VS CODE screen The code is correct with no error. I have already installed node js with the latest version and no updates are showing still node index.js is not running in the ...
kanan pandey's user avatar
0 votes
0 answers
6 views

Sequelize Error - belongsTo called with something that's not a subclass of Sequelize.Model

I'm encountering an issue with Sequelize when trying to define a belongsTo association between the Comment and User models. The error message I'm receiving is: comment.belongsTo called with something ...
Eric Risher's user avatar
0 votes
0 answers
23 views

webpack-cli TypeError: Unknown file extension ".ts" for webpack.config.ts

As many of us, I got the same error message when trying to run my new react project, and any of the solutions I found on internet not worked for me. The full error message is: [webpack-cli] Failed to ...
Wasyster's user avatar
  • 2,349
0 votes
0 answers
16 views

res.redirect giving 404 NotFound error even when the route is defined in the router

It's just a simple react application which has a login form so I want when the user sends their data after verification the user must be redirected to /home by res.redirect. So I was just checking ...
Piyush Pal's user avatar
-4 votes
0 answers
18 views

How use IRS Application-To-Application (A2A) Toolkit With Nodejs

i have the Application-To-Application (A2A) Toolkit IRS now i have bloker toolKit in java and .net but my project in nodejs kindly suggest me a path how i use the IRS toolkit into my project. kindly ...
A S STUDIO's user avatar
0 votes
1 answer
11 views

Dedupe peer dependencies when using "file:" to include local NPM package

How can I make NPM dedupe peer dependencies of a local NPM package installed using the file: pattern in package.json? The peer dependencies deduped correctly when the package is installed using npm ...
basse's user avatar
  • 1,140
-1 votes
2 answers
39 views

Getting error: "o.map is not a function" when using google maps distance matrix api in Node.js

I'm using the Google Maps API Node Client and calling the distancematrix function, but I'm getting an error that says o.map is not a function. const {Client} = require("@googlemaps/google-maps-...
Brian Zhou's user avatar
0 votes
0 answers
72 views

In Javascript, how to display the number of rows, using a div with contenteditable? (using textarea it worked, but with div it didn't)?

I created a vertical column in which all the numbers of the rows corresponding to a text editor are counted. Previously the row numbers were connected to a <textarea>, so I was able to correctly ...
Nodigap's user avatar
  • 195
0 votes
1 answer
14 views

How to convert and merge a list of webm files into a single large mp4 file with Node.js?

I am using MediaRecorder in the browser to get a chunk of webm file each 5 seconds, so it would end up with a list of webm files stored in AWS S3. And then, I am currently trying to convert them into ...
Terry Windwalker's user avatar
-1 votes
0 answers
21 views

Delete latex format

**Hello. i want to delete [tex] \frac{5}{3} - \frac{1}{2} + \frac{4}{3} \\ = \frac{10}{6} - \frac{3}{6} + \frac{8}{6} \\ = \frac{10 - 3 + 8}{6} \\ = \frac{15}{6} \\ = 2 \frac{3}{6} \\ = 2 \frac{1}{2} [...
yo ndk tau's user avatar
-1 votes
0 answers
17 views

getting CORS error when deployed my backend on render

i have made a course-selling-app and deployed the frontend on vercel and backend on render. everything was working fine locally but when i deployed it on render and replace the fetch request link in ...
Kaushik Garg's user avatar
0 votes
1 answer
14 views

After approval of revision of charges using the revise api of Paypal, The subscription is not giving updated information

I am using paypal rest apis to manage subscriptions and payments. The scenario is as follwoing: User subscribes to monthly plan e.g 1st Jan. In the middle of the month(15th jan), the user decides to ...
Abubakar Waris's user avatar
0 votes
1 answer
25 views

Trouble Implementing Custom Login with NextAuth.js and External API

I'm working on a Next.js application with authentication handled by a separate Node.js API deployed on Heroku. My goal is to use NextAuth.js for managing user sessions in the frontend, where the ...
Opeyemi Odedeyi's user avatar
0 votes
1 answer
23 views

Generate Wi-Fi QRCode with qr-image

The npm module qr-image allows generation of QRCodes with NodeJS, like the following: import qr from 'qr-image'; import fs from 'fs'; qr.image('https://google.com/search?q=hello%20world!', {type:'png'...
Andrew's user avatar
  • 401
0 votes
0 answers
21 views

Got an Error !! While Uploading a file in Node js using Formidable

I'm trying to understand and resolve this error message I'm getting while renaming a file with fs, uploaded using Formidable in Node.js. Code const formidable = require('formidable'); const http = ...
Anurag Pandey's user avatar
0 votes
1 answer
17 views

AES-GCM 256 encryption and decryption using nodejs and java

In an application I want the java frontend should take the encrypted text from nodejs and provided a fixed SECRET_KEY it should be able to decode it and the vice versa. Any help is appriciated. I am ...
Priyabrata Nayak's user avatar
0 votes
0 answers
8 views

How to run Frontity project on cPanel?

I have purchased a web domain and a web hosting that contains its own cPanel. I have also build my Frontity project as well. I also made sure that my web hosting supports Node.js. After updating the ...
junianss's user avatar
1 vote
0 answers
21 views

WISE API integration

Im a Software Engineer and Im integrating WISE API to my node.js app. In Sandbox environment, I can successfully transfer the payment to other recipent. But, Im getting an error on Live Environment. ...
Crazy Volt's user avatar
-2 votes
0 answers
20 views

Express route dont need await in this case

I have Controller like MyControl { public async index() { res.json(await getData()) } } and my route app.get('/test', (req, res) => { MyControl.index()}); It still working(i tested). and ...
DeLe's user avatar
  • 2,438
0 votes
0 answers
10 views

Rcon Connection not timing out, even when setting manual timeout

I'm using npm i rcon-client to make rcon calls, First I'm making a simple connection via: try { const rcon: Rcon= await Rcon.connect({host: server.address, port: server.rconPort, password: server....
Ciaran Reilly's user avatar
0 votes
0 answers
14 views

How to give Node.js user permissions to write to the project folder in Docker container runnig Alpine?

Say I have the following Dockerfile: FROM image WORKDIR /app COPY . . RUN npm install USER node CMS [npm, start] When the app starts, it apparently needs to write to the node_modules directory. ...
Ernesto Diaz's user avatar
0 votes
0 answers
12 views

findAll() sequelize returns in unexpected order

I'm trying to list all the data related to a table responsible for saving messages on a chat page using the sequelize ORM, but the attributes are being listed in alphabetical order according to the ...
Lucas_0502's user avatar
0 votes
0 answers
13 views

socket.io -- how to validate user input with server

I am trying to prompt user for input on the client, then check if the input is valid on the server. If the input is invalid the client should re-prompt until it receives a valid input. Only once the ...
user6615434's user avatar

1
2 3 4 5
9397