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
4 views

Saving changes to html file in electron

Im building an electron app where there is a main html file with a menu that has a few buttons. When each button is clicked it will load a local html file into an iframe. Inside the html files being ...
-3
votes
0answers
12 views

Find similarity between two strings in percent [closed]

What I am trying to do is essentially this but in javascript & node.js
-1
votes
0answers
11 views

Getting Object Error when using fetch GET to express js server

I am trying to get data from my express server using the fetch api. When I do this, i get an object error in return. Does anyone have any ideas on how to fix this? This is my express code: let express ...
0
votes
0answers
10 views

How do I categorize my data in a different format with the values in each data set? Using IF statement or Filter()? Please see the explanation

Currently, the data below is returning payments, pending, and inactive at the end of the code as seen. As you can see each data set is returning different values. I want to restructure the way I am ...
0
votes
0answers
3 views

How to Authenticate a Service Account for the Gmail API in Node Js?

So I'm using the Node.js Gmail library to send an email to another user. I was thinking of using a Service account to do just that. I've followed their documentation of passing the keyFile property ...
0
votes
0answers
6 views

Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app-compat/no-app)

My problem is that I want to use firebase and what is mentioned in the title appears. attached code import {initializeApp} from "firebase/app"; const firebaseConfig={ apiKey: "...
0
votes
0answers
4 views

I Useing Vue Install 'Datav' But it say module Not Found. I try To 'npm install' and 'cnpm install' but useless

node:internal/modules/cjs/loader:936 throw err; ^ Error: Cannot find module 'clone' Require stack: /Users/linnaishierhuachuan/Desktop/workspace/dev/cale-web/node_modules/_defaults@1.0.3@defaults/...
0
votes
0answers
6 views

javascript chatbot with limited user response

I am new to javascript and trying to build a chatbot. I want to give user limited options that they can pick from. ref link = https://www.chatbot.com/ question: How can i link these questions and ...
0
votes
0answers
5 views

TypeORM: how to call mutation from another mutation within the resolver

How do I call a mutation from another mutation within the same resolver in TypeORM if the function requires context as an argument? Something like: @Mutation() async addNote( @Ctx() { req }: ...
0
votes
0answers
7 views

sending text to incorrect record from database sql

I have this large function. Please be patient through reading this, my variable names are terrible, unfortunately, but you should get the gist of it. //running cronJob every 45 seconds on the ...
0
votes
0answers
9 views

React JS error - Expecting "CALC", ,..........."dimension", "number", got unexpected end of input CompileError: Begins at CSS selector undefined

I build my whole project, but when I'm doing yarn build, I'm getting this error from yarn i.e. Parse error on line 1: ^ Expecting "CALC", "LPAREN", "ADD", "SUB"...
0
votes
0answers
8 views

sending message using results from database sql node.js

I have this function. Apologies in advance for the terrible variable names. //running cronJob every 45 seconds on the minute var getTexts = new cronJob( '45 * * * * *', function(){ let weekday ...
0
votes
0answers
6 views

My Lambda hangs when accessing LaunchDarkly through a middy wrapper

We're using Middy as a wrapper with all our lambdas to deal with some logging and instrumentation logic, which is great. We also use LaunchDarkly (launchdarkly-node-server-sdk) to access feature flags ...
0
votes
0answers
19 views

Can I send an object to my database from a script without a form submit button?

I've set up some logic to run on a page but instead of console.logging the results, I'd like to send them to my database. Here's the script: const cookies = document.cookie //https://www.youtube.com/...
0
votes
0answers
10 views

Error while installing node-sass and nodemon (errno -4058)

I'm trying to install node-sass and nodemon with the command npm install -D node-sass nodemon but i get the following error: error code ENOENT error syscall spawn C:\ProgramData\Microsoft\Windows\...
0
votes
1answer
8 views

Creating a Google Cloud Task from a Firebase Function throws Error: 3 INVALID_ARGUMENT: Task.payload_type is not set

I am trying to create a Task in a Google Cloud Tasks Queue from a firebase function that calls when an entry in a firebase Realtime Database is created. However when the function is supposed to create ...
0
votes
0answers
11 views

Process.stdout.write appends "true" to the console output (again)

Before I begin, I would like to say that, yes, this question appears to be identical to this one. The difference is that this is in repl.it node.js, so the solution to that question doesn't work here. ...
0
votes
0answers
13 views

page reloads infinitly when writing to file node js

I was sending data from client side to server side using express and ajax and the transfer proccess works fine. The problem is i am tring to log the data to a .txt file after getting it but when i ...
0
votes
0answers
10 views

sql cannot insert with numbers as column name [duplicate]

I have a table called clients, in which i am trying to insert a new row. The insert query is like so: var addclient = "insert into clients (NAME, EMAIL, PHONE_NUMBER, TRAINER_NAME, 1, 2, 3, 4,...
0
votes
0answers
6 views

Node.js. Error 1006 code with status 403 WS

I'm trying to connect to wss://csgoexo.com/socket.io/ using socket.io-client@2.4.0 or WS with node js. I really don't understand what I'm doing wrong. If I'm trying to connect from Chrome browser - it ...
-1
votes
0answers
4 views

redis output conversion to a string of 1s and 0s (node)

I am planning to use Redis to store 1s or 0s in a variable length string, and toggle the bits by their offsets items over time. Such as if I have set 0000010010001 using: SETBIT draft1:888 5 1 SETBIT ...
0
votes
0answers
11 views

Uncaught SyntaxError: Cannot use import statement outside a module (Trying to use Shepard.js Library )

I am trying to use Shepard.js for my web app. I have installed the package using: npm install shepherd.js --save And I can see the folder in the node_modules folder in my web app's directory: /Users/...
0
votes
0answers
7 views

how to pipe data to a live nodejs application using process ID?

I have the following read/write nodejs application: const readline = require('readline'); const readStream = process.stdin const writeStream = process.stdout const readInterface = readline....
0
votes
1answer
19 views

Discord Bot isn't responding

For some reason, the basic ping pong command isn't working. I copied and pasted it from a website, but I am not sure what is wrong with it. const { Client, Intents } = require('discord.js'); const ...
-1
votes
0answers
14 views

regex for parsing object string with functions js

If I have a string which something like this: { var1: '...', func: () => { console.log('hello: ', process.env['a-var']); }, somethingElse: 'hello', ...
1
vote
1answer
18 views

i am trying to display data from an external api, if someone can please help me to fix the issue in my code

this is the error message i am getting TypeError: undefined is not an object (evaluating 'drinkList.drinks[0]') can you help me please fix the error and give me some solution so that i can use the app ...
0
votes
0answers
5 views

React Native packages cause project to be unable to build (react-native-screens, react-native-reanimate, etc.)

I'm currently trying to build a social media app and I'm setting up the navigation. Right now, when I yarn add some packages such as react-native-screens and react-native-reanimate, my project cannot ...
0
votes
1answer
22 views

How do I pass the guild variable to an event file in discord.js?

I am using the guide in discordjs.guide to have separate event listener files, and was trying to add another one. Specifically, the guildCreate event. In the index.js file, I have this: const ...
0
votes
1answer
21 views

Custom room Socket.io NodeJS

I am making an application with sockets and the need arises to broadcast information, but only to people who are inside a room. This is my code from the server.ts // Dependencies import express from '...
0
votes
0answers
8 views

RequestReply pattern with kafkajs

I have an issue and cannot resolve it by myself so asking for help. So I am going to implement sync request-reply pattern based on kafkajs. here is a short prototype: gist code I am faced with the ...
0
votes
0answers
14 views

What is the best way to implement Paypal and Stripe in Node.js?

I'm making an ecommerce website (for a portfolio project) and I was wondering if there were any examples on how to implement both Stripe and Paypal on a single website in Node.js. Unfortunately, I can'...
0
votes
0answers
18 views

How to show only one line in time in a multiple datasets in line-chart js

I have two lines in my charts.js graph. One is in scale from 1-10 and the other is 100 000-1 000 000 000. I would like to have them in one graph, not two, but not to show them in the same time because ...
1
vote
0answers
15 views

Puppeteer error on file download, download works

I want to download multiple pdf files from a site using Puppeteer. The download starts by accessing a url that ends with .../download. I am looping through an array of links and the first download ...
0
votes
0answers
8 views

Parse string of cookies to tough-cookie container

I'm gathering my cookies from a library as a string as the next one and I need to conver these to a tough-cookie container: "b=a; Path=/; Expires=Mon, 01 Nov 2021 21:46:17 GMT, c=d; expires=Tue, ...
0
votes
0answers
3 views

Mock postgres database connection(Pool, PoolClient, pg) using jest in typescript

I am new to typescript and have a simple function to fetch values from the Postgres database. I need to test the method by mocking the database, I have tried various approaches provided but nothing of ...
0
votes
1answer
14 views

Problem deploying Angular + Node with Heroku

I struggle deploying my node.js(TS)/angular app with heroku. When I try to deploy it on git with git push heroku master, every step go fine until the heroku-postbuild one. Hence, it returns the ...
0
votes
0answers
23 views

How do like buttons like instagrams one work? [closed]

This may be a very dumb question and I am not thinking, but how would one go about creating a like button, like Instagram. What I can't seem to figure out is how I would only allow the request if the ...
0
votes
1answer
19 views

Checking the result of sampling mongoose

In the study, I got stuck at one point. Trying to check if a value exists in MongoDB db collection documents using Mongoose. I have a separate function that searches for a DB entry using findOne. If ...
0
votes
0answers
8 views

Unexpected result when my API server handels aws SNS subscriotion confirmation message

I've created a topic in AWS SNS. Then I've created a subscription, in which an HTTP protocol is the endpoint . I've written a simple script in express js to response to messages received from AWS-SNS....
0
votes
0answers
7 views

Next.js passport and passport-steam with next-iron-session (Next.js, ts)

I have been trying to implement a steam auth into my next.js web app and haven't been able to get it working. Googling hasn't helped much. I can authorise against the steam openid endpoint. ...
0
votes
1answer
22 views

How to run react port and backend port in different ports?

I run a react frontend application. I also serve an API in the backend. When I do "node server.js" it runs at port 5000 and then when I npm start it tries to run at port 5000 but as it is ...
0
votes
0answers
8 views

TypeORM - How to insert into table with foreign key without fetching relation first

I am creating a small app using NestJS and TypeORM and I am having trouble inserting into a table that has a composite foreign key. Whenever the insert is executed, all columns get filled, except for ...
0
votes
1answer
18 views

Node version problems

I'm still bad at ubuntu and encountering some problems with my node versions. I just uninstalled it with brew. In my vue project I have : When I run node -v I get : v10.19.0 If I run node -v out of ...
0
votes
0answers
12 views

best or right approach to store BigNumber into postgres column for value with high precision

I am trying to store cryptocurrency balances into a table, some of which use 18 decimal places. In order to keep precision, I have to use the BigNumber Type from BigNumber.js, but when I set the ...
0
votes
0answers
17 views

How can I add multiple form controls dynamically when the button is clicked?

When the addIngredientsBtn is clicked, then the program is making a new textbox which is called ingredients in a new line, but I want to make that if I click on this button, then the program is making ...
0
votes
1answer
17 views

Remove propertis not present in interface with nodejs typescript

I'm using node.js with typescript and I have a question It is possible to remove properties that are not present in an interface when casting an object. interface IFooReal { prop1: ...
0
votes
0answers
14 views

Read Empty Cells node.js xlsx

I am using the node.js package xlsx to access an xlsx file using the following code: const XLSX = require("xlsx") wbInput.addEventListener("change", (evt) => { if (wbInput....
0
votes
1answer
24 views

Mongoose _id changes on every request

So, I am building an application using MongoDB as my Database. In my database exist 3 different schemas: Section, Category, and Product. The schemas are defined as follows: let ProductSchema = new ...
0
votes
0answers
8 views

Can not build svelte-kit static pages based on md files - build error

I am trying to build static sites with svelte-kit using static-adapter, but when I try to build a project the build process end with error showing that md-parser is not present. I am using this parser ...
0
votes
1answer
25 views

socket.io disconnects due to the size and frequency of data

In the code below: The client is supposed to start emitting images as long Base64 Strings to the server, one after another at close intervals. As soon as the first emit with a Base64 String takes ...

1
2 3 4 5
8140