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.
node.js
473,449
questions
0
votes
0
answers
7
views
How to optimize this code that gets video frame as image
I am quite new to mp4 file. But here is my working attempt to extract image frame given video url and a timestamp.
In reality the input url is an 8K 10hours 200GB video, so I can't download it all, I ...
0
votes
0
answers
11
views
How can I enable hot reloading on a react app with a client side package.json and server side (Express) package.json?
I have a react app with two package.jsons. The frontend currently won't update unless I run npm run build each time... I would like to see my frontend changes instantly without having to rebuild it ...
-1
votes
0
answers
13
views
how to check if a user exist in my postgresql database table?
Hello I'm new to learning about postgresql, and I'm to redo some old projects from the Odin project that uses postgresql instead of mongodb to practice. I'm stuck on trying to get a express-validator ...
0
votes
0
answers
6
views
How to Programmatically Kill Jest and All Its Child Processes After a Timeout?
I’m facing an issue with Jest where I’m trying to enforce a timeout on its execution and kill it along with all its spawned child processes if it exceeds this timeout.
When the javascript heap space ...
1
vote
0
answers
105
views
OpenAI API key with "proj-" prefix not working when read from .env file
I'm working on a Next.js/React/TypeScript project that integrates with the OpenAI API. I've encountered an issue with the new Project-based API keys feature.
Previously, I successfully used this setup:...
0
votes
0
answers
14
views
Convert pdf files to jpeg using Google Cloud Functions + GraphicsMagick
I have set up GraphicsMagick running on a Google Cloud Function, and it works with no issues when converting files, such as converting PNG to JPEG.
I am aware of the issue regarding Adobe PDF/PS files,...
-1
votes
0
answers
17
views
Am I overlooking the solution to "Module 'fs' has been externalized for browser compatibility"?
Just so you get an understanding of the situation, I am trying to build a web game library that runs on my computer. It is pretty much a rip off of the Nintendo Wii and 3DS. I'm using Vite as the ...
-1
votes
0
answers
17
views
How to append to JSON in azure storage-blob with nodejs
I have a lambda function in node20. I am using the azure storage blob library. I need to add content to an append blob in azure storage. But since this is a JSON, the content is added as if it were a ...
0
votes
0
answers
10
views
Websocket in nodejs does not work after page refresh
Hey I am getting into Node.js with express and I tried to use Websockets for Client-Server communication. The communication works fine until the client refreshs the page for some reason. The then ...
-1
votes
0
answers
10
views
Need Help: React App Showing 404 Errors on GitHub Pages Deployment
I'm having some trouble deploying my React app to GitHub Pages and I'm hoping someone here can help me out. The app works perfectly on my local machine, but once I deploy it, I'm getting a blank page ...
-4
votes
0
answers
29
views
API endpoints have different outputs than expected? [closed]
I'm experiencing an issue where my code is throwing an error that my friend doesn't encounter, despite us using the same version of the code. Here’s the error message I’m receiving:
TypeError: ...
0
votes
0
answers
13
views
TypeScript project automatically adds itself as a local dependency when running or building with Next.js or Express
I'm working on a TypeScript project using Next.js, and I've encountered an issue where the project automatically adds itself as a local dependency in the package.json file. Below is an example of my ...
0
votes
0
answers
7
views
Npm package publication failed
I was trying to publish my npm package and I was getting the same error
npm ERR! code ERR_INVALID_URL
npm ERR! Invalid URL
I tried changing some package.json code
how do I publish it.... I also ...
0
votes
0
answers
6
views
File upload is not working with Node.js clusters, socket.io and Multer
I am working on an application that was written in Node.js express with socket.io and Multer.During file upload i got error as unexpected end of form.
This is my code
master.js
require("dotenv&...
0
votes
0
answers
7
views
What is best way to do Azure AD access token validation node js
can someone provide the best way to implement access token validation on the api side using node js? Should we use kid?
Should we use kid or signature? or can we just match the tenant id and audience? ...
0
votes
0
answers
14
views
Cookies from deployed server are not being stored on browser
Hello I am working on a Express server which send cookies from backend to the frontend browser and uses that cookies for route protection.
The problem that I am encountering is, when I am trying to ...
0
votes
1
answer
11
views
React Native - API request is returning data in a second call when calling it for the first time
Does anyone can help me with this. I a trying to make an app to give people access to political data and make better choices with it. By somehow data is being returned only in the second call usualy ...
0
votes
1
answer
16
views
Express Cookie Sent With Header and Saved in Storage but After Reload they are gone
I've searched almost every topic about this issue but still could not fixed the problem. Set-Cookie is avaliable in response headers, see below, with a little warning. I am using http therefore i have ...
0
votes
0
answers
5
views
How can i have a nest application with a dropdown in my swagger with two versoins
``i have this code i want to have a dropdown of my different versions for my nest application how can i achieve this
my code below and an image of what i want to achieve
async function bootstrap() {
...
4
votes
1
answer
29
views
Firebase Authentication not working with ADC (Application Default Credentials)
I am using Firebase Admin SDK from my development machine (Node.js/Fastify). So I am trying to do something like this:
Initialize Firebase App 👇:
import * as firebaseAdmin from 'firebase-admin'
...
0
votes
0
answers
16
views
Livestream not reaching AWS endpoint
I'm trying to stream my live video into Amazon IVS and I don't see it on the live channels.
Is it possible I have a mistake in my FFMPEG configuration?
I'm expecting to see this in my playback url or ...
0
votes
1
answer
29
views
Socket.io not receiving data properly in React and Node JS
`I am trying to build a connection between a web application and a frontend using socket.io. I want it so that anytime I click on a button, I receive the JSON data that is being sent from the server ...
0
votes
0
answers
14
views
No job functions found - Azure function 4.0 with Typescript, gRPC server and client
I have created gRPC server and Azure Function App with Node.js and TypeScript.
The check the following directory structure -
MyGrpcFunctionApp -> src -> functions -> index.ts
//import { ...
1
vote
0
answers
46
views
How to retrieve image from s3 bucket and present it to the UI?
I am using a "API Gateway proxy integration" or "Lambda proxy integration". By having a handler file as:
import serverless from "serverless-http";
import app from "./...
-4
votes
0
answers
20
views
How to download a webpage with CORS policy restriction? [closed]
Is there any way to download a 3rd party webpage with NodeJS, when this page has CORS Policy restriction?
I am trying to develop a plugin for Lampa application (https://github.com/yumata/lampa-source/...
0
votes
0
answers
13
views
How to Efficiently Send updates in a Chat App with Node.js, Socket.io?
I'm developing a chat application with Node.js and Socket.io for the backend. The frontend is built with React.js for the web and Flutter for mobile platforms.
In many implementations I've seen, the ...
0
votes
0
answers
16
views
how to achieve zero-downtime deployment with pm2
I have a project involving a YAML file for deployment, and the flow is as follows:
Pull Changes: The YAML file pulls all the changes.
Start Temporary Instance: It starts a temporary instance to handle ...
0
votes
0
answers
33
views
Validation error: Invalid request headers
I'm currently exploring Docker and facing an issue when running my Angular frontend and Node.js backend inside Docker containers. Everything works fine when I run both applications locally on my ...
0
votes
1
answer
37
views
node.js API not loading environment variable correctly for azure cosmos mongoDB connection string
I have a microsoft azure database and have an api made with typescript to run on a node.js server, when i tested the api the night before all was working, wake up this morning and i keep getting an ...
2
votes
0
answers
569
views
How to deal with Axios vulnerabilities in 1.0.0 - 1.5.1 and >= 1.3.2 versions?
When I run npm install, I have a moderate vulnerability, how can I fix it?
1 moderate severity vulnerability
To address all issues, run:
npm audit fix
Run `npm audit` for details.
# npm audit ...
0
votes
0
answers
13
views
Mono repo add cli binary of local package to node_modules after building/transpiling
In our mono repo we have a package with a CLI written in Typescript and gets built/transpiled for production packaging. As the package.json bin targets the dist folder, which gets created after ...
0
votes
0
answers
10
views
Firebase migrate configuration from 1st gen to 2nd gen
I am trying to migrate some of firebase functions to 2nd gen and currently having issues on how to migrate the configurations.
The issue is there is an index.js file which fetches the configuration ...
-2
votes
0
answers
12
views
"libxmljs2": "^0.35.0" , "ip": "2.0.1" , "request": "^2.88.2", "requestretry": "^7.1.0" These npm Libraries are Highly Vulnerable and no fix Available
"libxmljs2": "^0.35.0" ,
"ip": "2.0.1" ,
"request": "^2.88.2",
"requestretry": "^7.1.0"
These npm Libraries are Highly ...
0
votes
0
answers
21
views
Test google cloud function using postman - 500 error
I have this code in a google cloud function
const functions = require('firebase-functions');
const { Buffer } = require('buffer')
//const busboy = require('busboy')
const crypto = require('crypto')
...
0
votes
1
answer
78
views
How to use AWS SSO with AWS-SDK 2.x
In my Nodejs app, I have been using aws-sdk (2.x) to get S3 objects. Below code works pretty fine.
const AWS = require("aws-sdk");
S3 = new AWS.S3({
accessKeyId: 'actual_accessKeyId',...
1
vote
0
answers
9
views
Storing recorded video files on Google Drive using Rclone
I am working on an application that records videos and saves them locally on my PC. However, I want to store these recordings directly on Google Drive instead of saving them locally. I am using Rclone ...
0
votes
0
answers
16
views
How to Redirect to an External URL with Headers in Next.js 14+
I'm working with Next.js 14+ and need to redirect a user from my Next.js server to an external URL. The catch is that I need to set a custom header before performing the redirect. However, I'm ...
0
votes
0
answers
7
views
My Llamaindex.TS chatbot can't answer questions from all the embedded data
I created a llamaindex chatbot that can answer questions about recommend car by extracting relevant information from a file I provide.
The entire code of the chatbot file is as follows:
test_rag.js
...
0
votes
0
answers
22
views
Getting an error setting up sentry for react-native project
followed the sentry documentation
executed this command in the project directory "npx @sentry/wizard@latest -s -i reactNative".
and got this error
▲ Something went wrong
node:fs:2352
return ...
-2
votes
0
answers
18
views
MongoDB like lightweight database for storing data locally [closed]
I am using mongoDB and now I need to have a light weight database that so I can replace mongoDB for local storage because for vending machines they comes with lower configuration good enough to run ...
0
votes
0
answers
17
views
node --env-file=.env is not directing to the correct folder?
Trying to teach myself environment variables, it took me a few minutes to learn dotenv, and I saw node now since v20 has a built-in similar feature. They are all in the same folder
//.env
HELLO = ...
0
votes
0
answers
15
views
not able to add bot in second teams channel not getting welcome in second, thrid channel but getting in first channel
not able to add bot in second teams channel not getting welcome in second, third channel but getting in first channel.
able to get welcome in second or third channel. but for now not getting.
please ...
0
votes
0
answers
26
views
I want to deploy Node Js directly to IIS without going through the intermediate step (URL Rewrite)
Today I have a question about Deploy.
I want to upload Node JS to IIS. But when I researched, I only saw instructions on how to use IISNode, PM2,... to run the source under localhost and then Rewrite ...
-5
votes
0
answers
24
views
Specific student login using her/his roll number [closed]
I created a teacher module in which teacher is adding students and this data is storing in mongodb collection name student overview which have many fields including basic details and email or password
...
-1
votes
1
answer
24
views
How to solve "Cannot use import statement outside a module" when you cannot set module type in package.json? [closed]
I am working on a Create-React-App project (writing in normal JS (.jsx), not TypeScript for what it's worth).
I wanted to modify some of the build files (swap out some references to local files with ...
0
votes
3
answers
32
views
How do I run 2 different functions from 1 file with 2 different command line prompts in Node.js?
I have a .js file in my project that imports an NPM package and has 2 functions that use that package:
//replacePaths.js
import {replaceInFile} from 'replace-in-file';
async function replace() {
...
0
votes
1
answer
29
views
Parallel execution with NodeJs and Puppeteer
I'm using NodeJs and Puppeteer to scrap data from a website.
My goal is to run multiple instances of Puppeteer when scraping data.
However, I may be doing something wrong. Because it is running only ...
0
votes
1
answer
14
views
Cannot delete files from uploads folder after uploading to S3 from multer diskstorage
When creating or updating an item, I have to upload multiple images so I use multer diskstorage to store the items in an uploads folder and then upload to S3. I want to delete those files from ...
-3
votes
0
answers
15
views
Node Module Install Vite Go Wrong
When I trying to install vite module, some bugs jump out.Install Bug
Here is the log for bugs during installation: https://docs.google.com/document/d/1BbnqpHyxK3xyuUG9Q3RD65CXdA1Z19--XgkkJ6ZkpHU/edit?...
-1
votes
1
answer
34
views
why are mysql2 npm package callbacks not working?
I want to use callback for handling my mysql queries and i am using mysql2 package.
i was expecting it to return a callback with error and results.
import express from 'express';
import * as dotenv ...