Most voted "node.js" questions
Node.js (or commonly Node) is a Javascript Runtime created with Chrome’s Javascript V8 engine. It allows you to run Javascript code without the need for a browser, raising the privileges to those found in other desktop languages. It is a technology strongly focused on non-blocking programming of I/O operations, which makes it very efficient for these operations.
Learn more…2,679 questions
Sort by count of
-
1
votes0
answers44
viewsProblem with asynchronous call
Good evening guys, all right? I’m in a boring situation and I don’t know how to fix it... The thing is, I’m developing an API to bridge the data that’s in a database to a third-party system, which…
-
1
votes1
answer52
viewsTreat req.files as null
Good night. I’m starting now with studies in web development and would like to know how to treat the following:What I developed was a blog, and in the area of creating posts, there is a form for you…
-
1
votes1
answer3465
viewsWorking with environment variables in Reactjs
Hello! I’m starting now with Reacjs. Usually in Nodejs I create a folder environments and put the index.ts or index.example.ts, with values there DB=nome_banco HOST=localhost USER=username When I…
-
1
votes2
answers575
viewsHelp with Promisse {<Pending>}
Talk personal, all right? I’m doing a role that will be responsible for validating the ZIP code informed by the user. Basically in the call of an API the user will send the ZIP code on body and I…
-
1
votes1
answer57
viewsError in useEffect accessing API data
I have the following hook that runs the API calls smoothly, returning the information and updating the components normally, but it brings some connection errors in the console, I believe these…
-
1
votes0
answers62
viewsRepository.findAndCount in related table column in typeorm/graphql
I am using typeorm and graphql in my api and want to make a findAndCount in a table called corresponding_users that has a one to one relation with the table users, but the query only works if Where…
-
1
votes1
answer64
viewsHow to display only the first user name in EJS
I’m blogging to train with Ode. In the application, the user registers in the database and, after logging in, goes to his page, where are all his articles. The field in SQL goes as name, and I…
-
1
votes1
answer191
viewsAxios returning HTML data, not JSON
I am developing small project to learn Act and I came across the following problem. When making a request in an Axios API by passing input as parameter to the route, Axios is returning an HTML, not…
-
1
votes0
answers30
viewsIs it possible to find out the length of an audio by requesting the Express?
Hello, all right? I am developing an application in Node.js with Express that has as one of its functions to receive an audio file and store the file information in the database. I am passing this…
-
1
votes0
answers23
viewsDear friends, how can I take the result of the code below and insert it into an HTML tag? Any way to do it using handlebars?
var http = require("https"); var options = { "method": "GET", "hostname": "freegeoip.app", "port": null, …
-
1
votes2
answers511
viewsUsing React, Typescript and Nodejs. Sending form for JSON user registration. I only know how to use Formdata. How to pass the elements as JSON?
Frontend import React, { useState, FormEvent } from 'react'; import { Link, useHistory } from 'react-router-dom'; import Header from '../../components/header/header' import './register.css' import…
-
1
votes1
answer46
viewsJSON replacing information with the same name
I want to record two or more names in a JSON file. However, when I try to do this, it saves only the last information. My job: async function grava_login(){ fs.writeFile("data.json",…
-
1
votes0
answers42
viewsSql - How to make a name or surname unique
Guys, the following is a table called sqlite, and I want the following I don’t want data to repeat, but if someone with a name and surname is registered, I want a person with the same name to be…
-
1
votes1
answer39
viewsUse value that is filled after a Promise
Guys, I’m developing an application that, according to the code below, searches the data in an API and with the result of this, makes other calls and makes a push in a variable, how can I access…
-
1
votes1
answer587
viewsRelationship Manytoone / Onetomany Typeorm does not save foreign key
Hello, I am developing an Node API using Typeorm and Sqlite3, but when using the Manytoone/Onetomany relationship, it does not save the foreign key. The scenario is as follows: I have a user who can…
-
1
votes0
answers26
viewsDisplay sequelize related table result
Good would like the help of you gentlemen, I have two tables customer and product a customer may have several products and one product belongs to only one customer, I have a relationship using…
-
1
votes0
answers30
viewsHow do I place a Node application on Heroku that runs full-time and is not an api?
Objective: to run Puppeteer on Heroku for at least 8 hours a day, without interruptions. I have a simple program on Puppeteer, it basically operates some accounts on websites and that’s it. That’s…
-
1
votes3
answers136
viewsHow to count from "1" instead of "0" in a Javascript array
I’m studying vectors and I used cars and parking spaces for example. But the console.log starts from the 0 and I wanted him to tell from the 1 and even so present 4 vacancies "1, 2 , 3, 4". Code:…
-
1
votes1
answer465
viewsHow to redirect to another route and pass variables in the process? Node + Express
I would like to redirect using res.redirect() so that the URL is also changed, but I’m not being able to send information in the process, could anyone tell me how to do that? I want to send together…
-
1
votes1
answer52
viewsI cannot access array item inside object
I am learning Javascript object orientation using Nodejs, and in a learning code I have created two classes: Person and Agenda, in which the Agenda has an array of the Person class, and in a search…
-
1
votes1
answer41
viewsDatabase return in asynchronous function with await
I have an asynchronous function that I need to use await in the return of the database to use this data later when doing the next insertion using the LAST_USER_ID() MYSQL, however, using the await…
-
1
votes2
answers53
viewsENUM Sequelize Error
I get the error RangeError: Maximum call stack size exceeded in my model statement. Follow code below: const { Model, DataTypes } = require('sequelize') class Usuario extends Model { static…
-
1
votes0
answers27
viewsCalling function NODEJS returns 400
I have a REST method that calls a Function. This Function checks if a vaccine already exists in the database, otherwise creates and returns to the method that called it. However, when calling the…
-
1
votes1
answer64
viewsError message when using ESLINT settings on two different Ides
Hello people for some time I am facing the following problem: I have a certain ESLINT configuration, however, I work with a team and only I like to use intellij, and with the ESLINT settings they…
-
1
votes0
answers22
viewsnodejs + oracledb Undefined result
I need help with a Function no nodejs. oracle js file. const oracledb = require("oracledb") const dbconfig = dbConfig = require('../database/dbconfig.js'); oracledb.getConnection({ user :…
-
1
votes0
answers116
viewsHow to return a new array within the Response.json() in Node.js?
I would like to know how to return a new object array in Response.json() to be visible in Inuit. I am receiving a lot of information from an api and the goal is to return to my frontend only an…
-
1
votes1
answer66
viewsWhy doesn’t anyone plug into my socket.io?
Hello! I have an api with the following example code: const app = require('express')() const http = require('http').Server(app) const io = require('socket.io')(http) const cors = require('cors')…
-
1
votes0
answers19
viewsDisplaying PDF (created in python) on the WEB with nodejs
I have a python script that generates a PDF file according to the information provided. I created an application in nodejs so that with each POST request, the script runs generating a new PDF file.…
-
1
votes1
answer1156
viewsCommand avatar to bot in Discord.js
I’m having trouble in command, I can give good avatar but it "ignores" users who use gif and turns it into jpg const Discord = require('discord.js'); //puxo a api aqui pq deu um embed module.exports…
-
1
votes1
answer133
viewsDiscord js Collector - paging messages do not work
These days I’m learning a little about developing bots, and in the process I researched pagination messages and ended up finding the discord.js collector. On the site there were some examples ready,…
-
1
votes0
answers45
viewsPerform automatic backup using Docker
My application is composed of Frontend (Vue.js) + Backend (Node.js with postgresql bank), before playing in production I dockerizei using Docker and Docker-Compose. The file below is…
-
1
votes1
answer360
viewsSend Formdata with Fetch API
I’m trying to send a Formdata() to the backend via Fetch API, but I can’t read the form inputs in NODEJS. By the way, req.body is empty. I’m wearing the body-parser and express. Backend: const…
-
1
votes3
answers127
viewsHow to call React routes with Nodejs?
I’m deploying a project that has Front in React and Back in Nodejs, but my host (Kinghost) asks me to deploy the Node app and within the same folder put the React Build, the FTP looks like this:…
-
1
votes1
answer39
viewshow to select an Array within an api in React?
You guys talking? All right? I have a problem in my React application with an api, you could help me? I want to show the names of the Pokemons of an api, but the array that gets the names of the…
-
1
votes0
answers35
viewsUse SQL output to insert into another table
What I’m trying to do is this: Make a search in a table, if you find the result. With the search result, insert the result in another table. I am developing in Nodejs, at first I imagine that I need…
-
1
votes1
answer116
viewsFunction returning [ Promise { <pending> } ]
Someone can help me, I’m with a function returning as pending, but do not know what can be already tried everything. follows my code: const episodes = seasons.map((el) => { const season = moviedb…
-
1
votes0
answers42
viewsProgram does not return to the loop after executing function
I have a robot that accesses an online system and downloads the files. It works with a delay between one download and another, but is taking time. On this system, I can only close the open tab after…
-
1
votes1
answer90
viewsCharset encoding/decoding error between DB2 and Nodejs
My problem: I have a Node application that sends messages to a specific Whatsapp (works normally, without character error). But when performing a query in the database (IBM DB2) and send this data…
javascript node.js character-encoding db2asked 3 years, 8 months ago AssuntosDev Gilberto Carlos 11 -
1
votes0
answers33
viewslogin Passport with email and password and passing id user as parameter in get
I am creating a website in React, Nodejs and Mongodb for a course project and I have a question in my login. My login prompts email and password to the user, but I created my method on the front…
-
1
votes2
answers29
viewsIcone does not appear as desired using Fontawesome
I have a table with stock buttons but, as they are inside the tag the result is different than expected. OBS: I need you to direct to a new route. How to fix it. I want the result on the right side.…
-
1
votes0
answers21
viewsCordova Music Controls Plugin, how to make it work?
I’ve done the plugin installation normally, tbm this is all ok with deploy and the app is running normal, but ñ know how to run the plugin to put the audio control in the notification bar, there are…
-
1
votes0
answers28
viewsajax returns no error or success
I have 3 ajax functions that are posting to a REST api //--------------------------cliente---------------------------------------------------------- const urlattime = document.location.origin;…
-
1
votes1
answer54
viewsreq.body of the empty Node.js in the angular
Good afternoon I am creating an API in Node.js and I am having problems with req.body received by express. The problem comes down to not being able to get the post Rest variables sent by angualr9,…
-
1
votes1
answer79
viewsNodejs: In a controller method, how to perform two different model functions?
I need to render a page with the data of an Author and the listing of their News. In this case, I am considering two tables: authors and news and their respective models. Database: Mysql;…
-
1
votes1
answer134
viewsPopulate() Ngoose only returns Objectid
I imagine it’s something very simple to solve but I’m already several hours trying to solve and I get nowhere. I’m developing a blog as a way of study but I’m having problems using the populate() of…
-
1
votes1
answer111
viewsHow to return the value of a function that uses Javascript promises?
I have a function that should check if a user is enrolled in Stripe. For this is made a request to a third server that returns an array of users. When I make the request, a promise is returned:…
-
1
votes1
answer26
viewsHow do I use WHERE using Knexjs as a conditional?
I am doing a put route to update, and using knexJS to update the data in the database, and in my code the solution I found was this below: dbKnex("game").where({ id: id }).select("*").then(data…
-
1
votes0
answers119
viewsToken refresh with JWT and Node.JS
I am making an API to understand how the Json Web Token, But he’s very simple, you know? So I can’t find content on how to do a token refresh that only lasts 5 minutes in a way that would be simple…
-
1
votes0
answers32
viewsProblem with Electron autoUpdate
Ola I’m trying to make a system of automatic updates using the autoupdater of Electron with Vue JS, a while ago I made this program the same way and it worked, nowadays it doesn’t work anymore. Code…
-
1
votes2
answers5055
viewsHow can I make a Reaction Registration Bot Discord.js
I was wondering how can I make a function on my bot with Discord.js registration by reactions added in a certain message? I saw some tutorials using the object raw but none currently works. My code…