Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
21 views

NodeJS: Mixed Content, content must be server over HTTPS instead of HTTP

NodeJS App running on frontend port:3000, backend port: 5000 in same Machine in Ubuntu (Linux). My Domain is SSL Configured. When frontend routing request to backend, getting mixed content error. Snap:...
2 votes
1 answer
311 views

Node js Google Authentication 2 FA Implementation Otp

I want to implement Google 2FA Authentication in node js How can i do this? I used speakeasy js library like below : const qrcode = require('qrcode'); const secret = speakeasy.generateSecret({ ...
0 votes
0 answers
12 views

Unable to Establish Connection from Node.js Application to Remote MySQL Database on NameCheap via SSH Tunnel

I'm having trouble setting up a connection from my Node.js application to a remote MySQL database hosted on NameCheap. I've tried multiple approaches, but nothing seems to work. What I've tried so ...
-1 votes
0 answers
15 views

Error "updates.map is not a function" when modifying cells of tables retrieved from BigQuery via an API

Here's the revised version of your question with the HTML structure and server details included: Title: Error "updates.map is not a function" when modifying cells of tables retrieved from ...
0 votes
0 answers
12 views

In NestJS, service is invalid when injected to another service?

I`d like to develop a rest app by NestJS and MikroOrm. And I prefer to use clean architecture to manage code, so a lot of modules are abstracted and a module need to be import to another module. What ...
0 votes
0 answers
6 views

Unhandled 'error' event with self-signed TLS certificate on node:http2 and wget

I created a simple HTTPS server with node:http2 package and self-signed certificate. This is a code for this app server: import {createSecureServer} from 'node:http2'; import {readFileSync} from 'node:...
0 votes
0 answers
22 views

FATAL ERROR: JavaScript heap out of memory only when deployed in Azure container apps

I have deployed the same (no code change) Node.js application in both Docker containers and Azure Container Apps. I've noticed a discrepancy in memory usage between the two environments. In Azure ...
0 votes
0 answers
29 views

Nodejs mongodb insert with `_id`, but `_id` becomes empty object

I'm inserting some records with _id = new ObjectId('a string with 24 length') to a collection in mongo with nodejs. But the result _id in mongo becomes an empty object: {}, resulting in failure in ...
0 votes
2 answers
23 views

not able to connect flutter app with node server

iam trying to connect my flutter app to a node server the flutter application has a registration screen that accepts username,password and email from users and it should be reflected to mongodb using ...
6 votes
9 answers
28k views

Facing problem on importing express from express

I am working on MERN app and while importing express it is showing error it shows SyntaxError: Cannot use import statement outside a module my code is import express from 'express'; const app = ...
0 votes
2 answers
13k views

"Peer dependency not installed" warning, but they are installed

On npm install, I am getting the following "peer dependency not installed" warnings: npm WARN [email protected] requires a peer of react@^0.14.1 but none is installed. You must install peer ...
-2 votes
1 answer
53 views

I'm stuck for 5 days on solving an issue with node.js

I'm taking the web application course and have been building my own website on the side. I'm trying to have items.js grab contents from the posts(.html) save them in an object, and then app.js will ...
0 votes
0 answers
22 views

Error: querySrv EREFUSED _mongodb._tcp.cluster0.vzygb.mongodb.net while connecting to mongodb

I've tried everything using chatgpt and configuring it again. Creating a new project and then creating a cluster and then doing all the process again. But this error seems to be stuck there. what is ...
0 votes
2 answers
2k views

mandatory arguments with commander-js

I was wondering if it is possible to create a command on commander that looks like this toggle (on|off) <args...> Where (on|off) means that you must choose one or the other, mandatory. ...
-1 votes
1 answer
23 views

'npm run dev' result: [Error: ENOENT: no such file or directory, open '/ddev/project-name/node_modules/@vue/apollo-composable/src/useApolloClient.ts']

I took over a Craft CMS project, which I successfully upgraded to the latest version of Craft 5. When I run the command needed to build the JS and CSS files npm run dev I get the following error: ...
3 votes
6 answers
20k views

process.env.PORT is undefined (in LinuxCloud environment)

I've been developing a nodejs app on C9 for some time and now I'm trying to make a copy of it on my remote host. So far, in the new environment node app.js works in the console but I am unable to view ...
0 votes
0 answers
19 views

Permission error (EACCES) with npm after password change on macOS, unable to use sudo command

I recently changed the password for my admin account in Users & Groups on macOS and tried to install React, but I encountered the following error: npm ERR! code EACCES npm ERR! syscall open npm ...
0 votes
0 answers
21 views

How can I mock up the express-validator withDefaults function using jest?

I am trying to unit test my validation segment which uses express-validator. This is the start of the segment: const errorMsgs = require('../lib/error-messages'); const validationResults = ...
1 vote
0 answers
11 views

Nodemon Crashes with 'bad ELF magic' Error on Termux in Android

I'm using Termux on my Android phone to run a simple Node.js server with nodemon. My server script (index.js) is written in JavaScript and should work fine, but when I run it with nodemon, I get the ...
0 votes
0 answers
15 views

Correct way to have several async processes in nodejs append to the same file

Is there a correct / better approach to using a file descriptor that several process running asynchronously can write to? e.g.: const allTheAsyncJobs = [] const fileDescriptor = fs.openSync(pathToFile,...
0 votes
0 answers
8 views

Upgrade to node18, and Server was keep failing with ECONNRESET

Has anyone faced the same issue, when I upgraded our web server to use node 18. The server kept failing to handle incoming requests with code: ECONNRESET See the full error stack below: "err&...
0 votes
0 answers
14 views

docker "copy . ." error Cannot copy to non-directory

When I run> docker build -t test . Getting this response: => ERROR [ 8/10] COPY . . ...
0 votes
2 answers
158 views

React Native getting React-Fabric error after upgrade to 74

I'm trying to make some updates to an older project and facing the normal headaches that come with supporting the updates to new iOS versions. After running some npm updates and a react native upgrade ...
0 votes
1 answer
29 views

Transform crypt() from PHP to Node.js

I'm having a problem converting crypt() from PHP to Node.js I have a database with the reg_users table where I have columns like username and password. In PHP, it's very simple to encrypt the password ...
0 votes
0 answers
6 views

Reaction Collector not collecting reactions in DMs

I am using Discordjs v14.15.3. The following script is supposed to send an invitation via DM to all members who have opted into our coffee chats to confirm that they are interested in participating ...
1 vote
3 answers
5k views

Sequelize HasMany not working

I am using sails-hook-sequelize and sails-hook-sequelize-blueprints in my sails.js app. I have a model called Site. module.exports = { attributes: { id: { type: Sequelize....
0 votes
0 answers
9 views

405 Error or 401 Error (sometimes) on Stripe Endpoint with Next.js, Vercel, and PM2: Unable to Create Checkout Session

I'm integrating Stripe into my Next.js application deployed on Vercel. The goal is to create a checkout session through a POST request to the /api/stripe/create-checkout-session endpoint. However, I'm ...
0 votes
1 answer
23 views

CollectorMessage from Discord.js v.14 with SlashCommands

I got a problen trying to create a command about a "pokequiz" where you have to guess the pokemon's name using SlashCommand and Collectors. When the user types the correct answer, the bot ...
4 votes
2 answers
29k views

"secret" option required for "app.use(express.cookieSession())"

The website does not specify any requirement of 'secret' for using app.use(express.cookieSession()); but when using the same in express it calls for 'secret option required. Why? Even when I provide ...
0 votes
2 answers
890 views

Docker, Entrypoint.sh access denied

I am trying to run a docker container by entering "docker compose up -d", but it keeps giving me the message: Error response from daemon: failed to create shim task: OCI runtime create ...
0 votes
1 answer
14 views

beforeSoftRemove hook not updating database entry using Nest.js and TypeORM

I want to implement a solution in Nest.js and TypeORM application that every record that is getting created should have createdById, updatedById and deletedById against their actions. Let me share the ...
-1 votes
0 answers
22 views

Does anyone know how I can set my chatbot status to "typing" on whatsapp when generating an answer?

i’m creating a chatbot using the graph api on meta for devs, does anyone knows how can I send a request to show when the chatbot is typing? I found the sender_actions structure, after trying to send a ...
0 votes
1 answer
19 views

Should this HTTP contract class be considered a repository, service, or just an HTTP client?

I'm looking for some advice or best practices for a pattern we're discussing internally. We have a class (example below) that defines an HTTP contract to interact with an external REST API. The class ...
0 votes
0 answers
18 views

Why aren't SSE messages automatically rendering in my app's live feed?

I'm building a CRM application that uses Server-Sent Events to receive real-time updates for new messages (pretty simplistic chat UI). While the messages update when I click on a user in the ...
0 votes
1 answer
27 views

Issues with Emitting Events to Socket.IO Server on Different URLs and JSON Data Conversion

I am working on a Node.js backend project using Socket.IO and am facing two issues when trying to interact with the Socket.IO endpoints via Postman: 1. Connection and Event Emission Issue on Different ...
0 votes
1 answer
1k views

Randomly throwing MongoPoolClearedError

I have a problem with my database. I frequently (several time a day) have crash during queries. It throws this error: PoolClearedError [MongoPoolClearedError]: Connection pool for db2.prod.someDomain....
0 votes
0 answers
22 views

Request fails when sending from fetch but succeeds in api client

I am sending the following fetch request: try { const response = await fetch(`http://localhost:3000/fs`, { headers: { Accept: "*/*", method: "readFile&...
1 vote
4 answers
798 views

Add new field to mongo if not exist

I have this document in my mongo-db { "key": 1, "name" "abc" } now I want to update it and want to set age as 20 so I used update query by keeping upsert as ...
0 votes
0 answers
9 views

Mystery Bug Fix in Electron v26 and Mac App Store build

I have an Electron app that uses a native add-on to access the Photos library on macOS. This feature didn't work in the MAS (Mac App Store) build when the sandbox is enabled. Here is what I observed: ...
2 votes
1 answer
1k views

How to generate NodeJS signature code from hmacsha1

timestamp and device_id are always changed when I request a function to generate signature, but the signature hash it generates is always ea6b458e9a840b7f93236244bf1ea7cb564a8f08 Hash generating ...
1 vote
2 answers
35 views

Swagger OpenAPI issue with bundling up files

I am using swagger-cli to bundle my openapi.yaml file that has refs to other .yaml files in sub dirs. The api documentation when I spin up the server works without any issues and displays all the ...
-2 votes
1 answer
27 views

Why am I getting undefined when I console req.query? [closed]

This is api.js file: function apiKey(res, req, next) { const api_key = '12345678'; console.log(req.query); next(); } module.exports = apiKey;
0 votes
1 answer
861 views

Mongodb FindOne returns object with undefined property

I'm trying to get a user from my collection with findOne using its name attribute but it returns undefined whereas my user is in the db. This is my schema : var schema = new mongoose.Schema({ name: {...
1 vote
1 answer
91 views

Why it is output undefined?

I making toy-programming language on JS, and I met some trouble. Namely in labels. According to my idea, everything that comes after the label is entered into the object and later runs when necessary ...
0 votes
1 answer
42 views

Cannot read property 'find' of undefined mongodb

I am starting to implement mongoose in a nodejs project. I have created a test record in a collection to test the CRUD operations from the back, I am trying to test the find() property of mongo but I ...
2 votes
0 answers
370 views

Get method of cls-hooked returns undefined

I have question. I am testing cls-hooked library and, I saw cls-hooked examples so, I used cls-hooked library like that cls-hooked examples. But, cls-hooked get() method returns undefined When I use ...
-1 votes
0 answers
21 views

how to prevent duplicate keys into database with mongodb and expressjs

i am working a crude project with mongodb expressjs and pug(formerly knone as jade) i am stuck on preventing duplicate keys both on Front-end and backend. this is what i did.... let mongoose = require(...
-1 votes
0 answers
13 views

I was using VS code and node js for a while now and after a few weeks my keyboard started glitching , any solution?

When I deleted Node.js and VS Code, it started working normally and when I downloaded VS Code and Node.js again, the glitching came back. Keyboard even stopped working at times. Is anyone facing this ?...
0 votes
1 answer
43 views

Type error in TypeScript 5.6: Type '() => Generator<string, void, any>' is not assignable to type '() => BuiltinIterator<string, undefined, any>'

For my unit tests I create a fake window.location object. Here's the slightly simplified code: function getFakeLocation(getCurrentUrl: () => URL): Location { return { get ancestorOrigins(): ...
0 votes
3 answers
3k views

Lambda Elasticache redis connection refused

I'm trying to connect to Elasticache redis instance from lambda. Lambda and Elasticache are on same vpc and Lambda's execution role has all the permission for elasticache. But still I'm getting ...

1
2 3 4 5
9481