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 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
0answers
3 views

MongoError: E11000 duplicate key error collection: orders.events index: _id_ dup key: { _id: ObjectId('608e6a80931b45001aa7f910') }

So actually I,m getting this error. I have 2 models: one for event and the other for orders where i"m first storing the event instance in database from one routes and on other routes when i find ...
0
votes
0answers
2 views

How to fix “ExceptionInInitializerError” with Selenium when trying to connect to Firefox in a nodejs project

I have a nodejs project running in localhost, and i'm trying to make some tests with Selenium 3.141 in Java project. I'm using geckodrive 0.24 and Firefox 86.0 for the navigator. I had already used ...
0
votes
0answers
12 views

TypeError: command.execute is not a function discord.js

I try to make a economy system but it doesn't work. When i try to use the command (v.addbal @user "amount") i get a error in my console. Bot message: https://imgur.com/nqvUfry Console error: ...
0
votes
0answers
7 views

How do I connect my client to a server via websocket, where the server is connected to another server

I'm new to using websockets and I am trying to do the following with the ws package: Client <--> Server X <--> Server Y Client is connected to server X -- which is my server -- via ...
0
votes
0answers
9 views

Bulding JavaScript for Node and modern browser with TypeScript and Babel (without any bundler), possibile?

What I'm trying to accomplish is: Use TypeScript with modern syntax (DOM, ESNext as lib) Target Node 10.x and up (ES2018 + CommonJS modules) Target modern browsers (Babel preset env + ES6 modules) ...
0
votes
1answer
12 views

how to add a variable to a textarea (MERN)

I'm working on my MERN application, where it includes a textarea. I want to let the user add the variable in between the text template. Eg., enter image description here How can I achieve this logic ...
0
votes
0answers
7 views

How to parse a JSON sent via Insomnia

I have my small server with fastify, I have set all routes and now I need to test the backend to parse the JSON in the body. ... const isJSON = (str) => { try { console.log(str); JSON....
-2
votes
0answers
8 views

better sqlite3 module issue

Error: The module '\?\C:\Users\me\visual studio\bot\Cloud-hosted-bot\node_modules\better-sqlite3\build\Release\better_sqlite3.node'was compiled against a different Node.js version using ...
0
votes
0answers
7 views

How to upload Files and Other fields with Request Body in Nestjs

I want to upload three fields like: Example Data: partner_id: 3638, review: [{'product_id': 155, 'order_sku_id': 155, 'review_title': 'Orange Review','rating': 5 }], review_images[0][0]: ImageFile00 ...
0
votes
0answers
13 views

I'm trying to convert this string into gzip

I'm using Node.JS and I'm trying to convert this string that looks like this {"blocks":[{"id":"block","block":"event","args":{"items&...
0
votes
0answers
4 views

webpack changed __dirname in node_modules

I am using electron-forge webpack and typescript template to create a simple electron app. When using aws-iot-device-sdk-v2 I get this error: Error: AWS CRT binary not present in any of the following ...
1
vote
0answers
10 views

Npm thinks I'm on Windows?

When in my project I try to build I get this: [!] Error: Unexpected character '�' (Note that you need plugins to import files that are not JavaScript) node_modules/bson/ext/win32/x64/bson.node (1:2) ...
0
votes
1answer
7 views

MissingSchemaError: Schema hasn't been registered for model “User”. Use mongoose.model(name, schema)

I'm working on a MERN application referring to a MERN tutorial. I'm stuck with an error and I tried searching with error but couldn't find the solution for this error. I created the model of the user ...
-1
votes
0answers
14 views

Why browser shows CORS error despite adding headers after switching back to Test URLs from Production URLs?

I'm using a NodeJS application with Express as the backend. And React at the front end. The code was working absolutely fine (no CORS errors) till I decided to host it on Heroku. I changed all the ...
0
votes
0answers
14 views

How to loop message collectors?

I'm trying to make a fight command with Discord.js. I've tried using while and for loops but they don't work. Here's my code so far: db.set(`p2name_${message.channel.id}`, message.mentions.users....
0
votes
0answers
11 views

SyntaxError: Unexpected token ';' in <path> while compiling ejs

Hey wonderful geniuses of stack overflow *Relevant to this question i'm creating an ID card generator site, where you go and input your details to generate and ID i'm using node js, i'm using ejs ...
0
votes
0answers
7 views

Vuetify Checbkox Update with each API update

I tried really hard to make it work... I was not successful So, I have few Checkboxes where each will contain a City. When user Clicks a City, an API call is made to Elasticsearch and the data is ...
1
vote
0answers
10 views

Puppeteer - custom fonts not loading in pdf but do appear in screenshots

I am trying create PDF files dynamically using the puppeteer lib but the pdf that is generated doesn't use the custom fonts (.woff) instead uses default system font i.e. Times new roman. I used Next....
4
votes
1answer
34 views

I get an uncaught error after running my code

I am working on a project and every time node run my code the browser console gives me this : Uncaught TypeError: Failed to resolve module specifier "express". Relative references must start ...
2
votes
1answer
22 views

Docker - /bin/sh: nodemon: not found

I have the following docker file. #Dockerfile FROM node:alpine WORKDIR /backend COPY package*.json . RUN yarn COPY . . EXPOSE 5000 CMD ["yarn", "dev"] Nodemon works as ...
0
votes
0answers
14 views

Creates a button that when pressed, changes the text-TypeScript, React

I am new in this language and i couldn't find a solution. this is my code: {<a>Right now {order.status === 'full' ? 'x' : 'y'}</a>} And I want to change the text to a button that when ...
0
votes
0answers
6 views

Firebase Firestore: Issues with combining exclusion query and sorting

Here is what I am trying to do with my Firestore database: Query from 'posts' collection, which contains the following fields: 'userid', 'time', and 'listid'. Query the latest 4 documents that ...
0
votes
0answers
4 views

Docusign NodeJS EnvelopeViews: createRecipient UNKNOWN_ENVELOPE_RECIPIENT

I call the GET envelope recipients API https://demo.docusign.net/restapi/v2.1/accounts/cf70dfa7-a861-4029-b149-5360c090ebfa/envelopes/4de0ca11-e07b-4ff0-936f-cdd37ff18ed2/recipients and it returns ...
0
votes
1answer
19 views

Update all objects in a MongoDB document array field

What I'm trying to do I am trying to update all objects inside a field array in a MongoDB document using mongoose. What I have User document { id: <ObjectId>, ... notifications: [ { ...
0
votes
1answer
8 views

Failed to commit transaction (conflicting files) when updating packages on Manjaro

sudo pacman -Syu I try updating all the packages using pacman on my Manjaro Linux and pacman necessarily does everything to download the latest updates of all the available packages and after checking ...
0
votes
1answer
15 views

Can't deploy cloud functions after deleting old files from artifacts

My Angular website, hosted on Firebase was getting charged for cloud storage since the beginning of this year, because of us.artifacts.<project-id> bucket. Yesterday, I checked the storage usage ...
0
votes
1answer
11 views

Properly send NodeJS Buffer as form data to Spring boot

I have NodeJS application where I have image buffer qrCode const qrCodeData = Buffer.from(body).toString('base64'); //body received, not sure if base64 is correct ...
0
votes
0answers
4 views

Nestjs | ConfigModule | Use (or inject) a service inside `validate` function

import { validate } from './env.validation'; @Module({ imports: [ ConfigModule.forRoot({ validate, }), ], }) export class AppModule {} How can I use some service from within ...
0
votes
1answer
22 views

How do I fix this error that I'm getting while making a POST request in nodejs

So, I wrote the following code to post an image on Reddit using Reddit API. const request = require('request') let access_token = "redacted" let url = 'https://oauth.reddit.com/api/submit' ...
0
votes
0answers
9 views

Problem with Quick.DB/better-sqlite3 install script

I'm using Quick.DB as a database for fetching and sending data for my discord.js bot. However, when I try installing my dependencies, it returns me this error while it installs better-sqlite3 ...
0
votes
0answers
19 views

Multiple react apps on multiple domains. How to hide port in url

I got 2 domains "abc.com" and "def.com". On ports 443 and 3001 I got React apps. Both domains go to same server. I would like htaccess to run react app from port 3001 ( without ...
0
votes
0answers
9 views

Using Apaches ProxyPass with additional static files for specific url path

I use Apache 2.4 on Linux for a bunch of domains - each configured well. Some VirtualHost configurations use the ProxyPass Module and some point on DocumentRoot. Now I need to configure the following: ...
0
votes
1answer
12 views

Unable to use several find() functions using mongoose to pass in res.render

I'm working on a website that shows several movies in different category groups on the home page, hence my attempt to use several find functions (mongoose) and pass them in a render to display them in ...
1
vote
1answer
20 views

node https module send file to php server

How to send HTTP post request that include a jpg file to php server with node https module? I tried using request module but its unreliable (timed out most of the time) and its already deprecated. ...
0
votes
0answers
13 views

Invariant Violation: “main” has not been registered?

Anyone know what I should be doing for the error below? Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider at node_modules/react-native/Libraries/Core/...
0
votes
1answer
26 views

Project is not running in Angular

My project in Angular is not getting build. When I run the app(ng serve -o), it's showing this message: `An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'...
0
votes
0answers
5 views

Node.js application building on local server but not heroku

I am trying to run my node.js application on Heroku but I run into this error while building the application. Has anyone run into a similar issue? The application runs on my local browser perfectly ...
0
votes
0answers
5 views

How could I handle the Err of TLS certificate with fabric-sdk-node

I'm trying to build a web front end of a fabric-network, and after I completed the registerAdmin and registerUser, I got err when I was tring to run my js code. root@oyu-virtual-machine:~/hyperledger-...
0
votes
0answers
22 views

How can I send a input array to backend?

I am trying to create a form that we can send an array to backend using input with mapping but I ended up created input name different from useState. Like it send seperate data to backend. Here is my ...
0
votes
0answers
16 views

texpress-session not setting cookie in react app when deployed to heroku

I am unable to set session cookies in the browser with my MERN stack app. When both the express server and the react front end are running locally the cookies are set no problem. The problem raises ...
0
votes
1answer
12 views

How do you disable a parent directory but not a child sub directory in /public_html

My basic problem is I am using node.js server in a vps apache server. So in my .htaccess file in the /public_html directory RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteCond %{...
0
votes
1answer
20 views

Returning csv data from multiple files in a directory in JavaScript

I am trying to get data from multiple CSV files using 'csvtojson'. Acquired the array of file names in a directory. Ran forEach to get the data from different CSV files in JSON and pushed into a ...
0
votes
0answers
15 views

Heroku, Node.js, PostgreSQL error: no pg_hba.conf entry for host

I need serious help. My Heroku app crash a week ago and I have been troubleshooting for 3 days with no success. Tried to change the connection code to ssl and also did some changes to pg_hba.conf and ...
-7
votes
0answers
28 views

fire string into an operating system entry when executing a keyboard shortcut [closed]

good night! I need guidance to solve a professional problem, I hope someone helps me, haha. I will describe the problem in a few different ways, so that it is possible to understand 100%, come on ... ...
0
votes
0answers
10 views

Redis. How would I utilize this in-memory database for my project when most is done with WebSocket Secure

I need to convert over and this will be huge on my project I'm thinking but just want to understand before I approach this new library/technology. Will I be able to JSON pub/sub to all servers like ...
-5
votes
0answers
32 views

How to scale CPU intensive application for multiple users what is the industry standard? [closed]

I am working on one automation framework and I spawn some processes which are written in bash or Python and does some work and returns an output and then process to database and display to user but in ...
0
votes
1answer
16 views

Testing promise request in nodejs using mocha

I want to test the response in nodejs using request, I tried doing some unit test but I cannot get inside the request function let request = require('request'); function doRequest() { new Promise(...
0
votes
0answers
6 views

Make Flatlist asynchrone react native

I have an flatlist which isn't asynchrone so if i update something in my view i have to go back to the home screen and re-enter to check the modifications or save my project , i have implemented ...
0
votes
0answers
8 views

In NestJS I would like to know in which file faulty code I made that makes the application threw an error (while starting application ~nest start~)

In the current situatuion console displays only root level libraries file location which not helpful exatly. In other famous programming languages it is more clear to understand why error occured and ...
0
votes
2answers
15 views

How to make return wait for MySQL connection to end? Node.js

I'm new to Node.js I'm testing some code on Wix to check my database if a account name already exists prior to allowing a new one to be created (I'm purposely not using the WHERE tag at the moment for ...

1
2 3 4 5
7689