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
-
0
votes0
answers57
viewsHow to undo a Migration that has reference (References)?
I have a Migration that adds a reference to a column (foreign key), but at the time I run db:migrate:undo He doesn’t break up the relationship at the bank. After some tests the migrations continue…
-
0
votes1
answer222
viewsAdd values from a column (array) - Vue.js?
I would like to know how to add up the values of a array to appear on the screen. Example has a column with gross value, which contains the gross value of each component, wanted to add these values.…
-
0
votes1
answer33
viewssocket io error client side
When connecting to the server via socket io the browser returns the following error: http://localhost:3010/socket.io/?EIO=3&transport=polling&t=NOeqJv8 400 (Bad Request) The following code…
-
0
votes0
answers33
viewsHow do I accept request with ISO-8859-1 charset?
I have in my system a POST route for my clients to send information. Where a client is trying to send a POST request with the following header: Content-Type: application/x-www-form-urlencoded;…
-
0
votes0
answers16
viewsUpdating a subcollection on Mongodb
I have a Collection called purchase with various data, among them: const purchase = new Schema({ datePurchase:{type: Date, default: Date.now()}, ... products:[{ product: {type: String}, category:…
-
0
votes0
answers142
viewsRelationship error between tables with Sequelize: Unknown column
I am creating a stock management system where a model has category one for many, doing the insertion correctly, but at the time of listing it returns me the error: SELECT `luminarias`.`id`,…
-
0
votes0
answers46
viewsPassport.js local Strategy returning error 'Missing credentials'
I am trying to make a login system (authentication) using the Passport and the Express. However, it always goes back to the log page and returns the error Missing Credentials, I have tried to search…
-
0
votes1
answer106
viewsHow can I count how many times a number appears in multiple arrays?
I’m trying to make an application in which I enter a txt file with the results of the last mega Sena and parse it line by line. My goal is to see how many times a certain number has appeared since…
-
0
votes0
answers42
viewsreturn in the db form a field sum and also other collection values to include in the array
I want to create a query in mongodb where it returns the total value of all the houses of a certain type, and also which street of these houses. At the moment I’m just making a query that brings the…
-
0
votes0
answers41
viewsWhat is the best way to perform a dependent insertion of another entry into the database using Typeorm?
The entities involved are the following (cardinality Onetoone) User import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from "typeorm"; import Profile from "./Profile"; @Entity()…
-
0
votes0
answers41
viewsHow to select Whatsapp nodejs + Selenium input
Language in Nodejs + Selenium I’m making a simple bot in nodejs and Selenium, I just need to be able to select the input to send file but I’m not getting, It is the first file type input, but I’m…
-
0
votes0
answers28
viewsHow to change the Sequelize response object?
I would like to know how to change the answer object in sequelize findAll. I used the code below to make the change but I do not know if in Sequelize itself can do. then(chars => {…
-
0
votes0
answers7
viewsid captured in the request capturing the name of scripts files
The part of the route where the error is happening is this, the beginning of the controller is described like this module.exports.showOneCampground = async (req, res)=>{ const { id } =…
-
0
votes1
answer58
viewsCompare if the value of a variable is the same as the value already saved in the database
Using Java Script, Nodejs, Adonisframework, Mysql, Lucid ORM I need to check compare if the value sent by the client through the API is the same present in my database. I need to check if the…
-
0
votes1
answer253
viewsPagseguro API 401 error - Unauthorized; Error logging in paid
[RESOLVED] I made a simple Node server to test the Pagseguro API and am having problems with error 401. In a video I saw that to make requests for the Pagseguro API it is necessary to have an SSL…
-
0
votes1
answer52
viewsHow to develop with Cooldown with Express-Session
Hello, I am developing a feedback system. The person fills in some data, sends and saves in the database. However, for security reasons, I wanted to create a cooldown so that the person only send…
-
0
votes0
answers269
viewsHow to resolve Typeerror: Cannot read Property 'Create' of Undefined?
const express = require ("express"); const app = express(); const handlebars = require ('express-handlebars'); const bodyParser= require ('body-parser'); const Post = require ('./models/Post').…
-
0
votes1
answer42
viewsIs it possible to use ASYNC AWAIT when receiving a PROMISE return?
I would like to know if it is possible to receive the return of a Promise using async await? I created a file where I read a file and return the string of that file, to receive this variable, in my…
-
0
votes1
answer286
viewsNext.js does not load jsx
Recently I’ve been researching about Next, the js framework of the moment, and I want to start training with it with some projects. The problem is it doesn’t run on my computer, no matter what I do.…
-
0
votes0
answers29
viewsProblem with Body-Parser
I have a problem with Runtime of Javascriptthe NodeJs, I finished the modules bodyParser, express and handlebars Yet I can’t bring myself to parameter req, exactly the req.body.name and the…
-
0
votes1
answer35
viewsCreate a table separating dates by quarter with React and Node
The table needs to look like this: She’s like this: I was able to create a table using Sequelize with the data of each unit, with cnpj and everything, and I made a table of dates related to this…
-
0
votes1
answer65
viewsChoosing how many DIV’s to mount at a time within a . map()
Good morning guys, I went through a recent situation where I had to resolve the basis of a gambiarra but I wonder if there is a way to do what I had in mind at the time but could not accomplish. The…
-
0
votes1
answer68
viewsLoop of promises does not return JSON in Node.js
I have an array with the Events to be searched, to check if there is another one on the same day and time. The code below returns me the existing events without problem, but only on the console.log.…
javascript node.js promises async-awaitasked 3 years, 9 months ago Thiago Augusto Monteiro Pontes 3 -
0
votes1
answer129
views(Sequelize) Cannot read Property 'title' of Undefined
Hello, I am developing a cart system for Ecommerce, and within the Model Cart, I have made a relationship with User Model and Product Model, so I can access the two items through the Cart. However,…
-
0
votes1
answer109
views -
0
votes1
answer23
viewsHeroku - Error run seeder for popular BD
Hello. I recently deployed an application to Heroku (Node + Adonis + Mysql + React) and I am facing some problems. It has an admin user who is responsible for registering other users, so I have some…
-
0
votes3
answers220
viewsWhy can’t I use module export to export variable
Explanation: Good guys in my app.js file have many lines of codic ... Some functions ... But I think it doesn’t matter much, so what I want to do is export a variable that I need to use in another…
-
0
votes0
answers53
viewsHow to modify the multer filename with front variables?
Good morning, I am creating an application React and Node, and at the moment I need to upload a PDF file, the code works well, but I wanted to know how when it comes to mounting the filename of the…
-
0
votes0
answers17
viewshow to read Firebase data via Dialogflow
Hello! I’m having difficulty reading the Firebase data via Dialogflow, I tried several ways, I saw some tutorials, but I did not identify the error, if anyone can help me, I thank. Firebase rules: {…
-
0
votes0
answers22
viewsWhy can’t I access the variable outside the while loop in Node.js?
I have a module that takes public information from the TJPB from the number of a process. This information can be at any of nine different addresses. Therefore, I make requests to each of these…
-
0
votes0
answers13
viewsWhy can’t the return inside the foreach understand the response type of a function of one of a class? Typescript
I can access through the for.. of, But through the foreach I can’t, the function can’t understand that inside the foreach is returning a function that is of type Ihttpresponse. interface…
-
0
votes1
answer126
viewsCannot POST nodejs
I am making a nodejs application and came across the following error: Cannot POST /news/news/save how do I fix? admin js. module.exports = function(application){…
-
0
votes0
answers50
viewsTypeerror: Cannot read Property 'Brl' of Undefined [Discordjs]
I’m trying to do a function for my Discord bot that does a request on a cryptocurrency api, it’s working normally if I put the cryptocurrency name manually in the api, but I would like to use an…
-
0
votes0
answers40
viewsMy answer returns Undefined
I’m using Node to develop an application. I am making a query in the bank to pull some values. These values are: 'imagem1', 'imagem2, 'imagem3'. I want to use a for to apply a function in the 3…
-
0
votes1
answer130
viewsUpdate only in fields that have content other than null - Node with Mongoose
I have a question about giving update using Mongoose. I already have the route done and working, only I’m having a problem. So I’ve unstructured all the data I’m going to take from req.body, then…
-
0
votes0
answers11
viewsSet column type for text using exceljs
Hello! I am using exceljs to export excel file I would like to define before exporting the column type to String Currently I’m doing so: const EXCEL_TYPE =…
-
0
votes1
answer33
viewsJSON return format - NODE
I am mounting the REST API in Node, already closed the connections with Oracle and is working, however I need a JSON return different from the way being returned Currently he’s returning me this…
-
0
votes1
answer301
viewsInvalid or Unexpected token
When trying to execute the code below fetch(`https://mktp.oversystem.com.br:8443/MKTPlace2/rest/sinistrosZurich`, { method: "GET", header: { "Access-token": "aC0009E000081007F400dF210",…
-
0
votes0
answers65
viewsNode start: How to run 2 commands?
When I try to execute the node start where I have only tsc it works. Correctly compiles the Typescript files. When I try to run the node start where I have only nodemon ./dist/app it works. Runs my…
-
0
votes1
answer49
viewsDelay in response to MYSQL query
I have a problem that I seek solution but believe that I may not be implementing correctly. I have a query to mysql that returns me extensions, this function should return me to another class so…
-
0
votes1
answer30
viewsError while reading a file and running line by line in the nodejs
Good afternoon, I am creating a code to read a text file and run line by line using the execa packages and list in the nodejs, but it is checking the task function first then executes the commands.…
-
0
votes0
answers16
viewsI am unable to return complete data with adonisjs
Code of the Model 'use strict' const honorarios = require('../Metodos/honorarios') /** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */ const Model = use('Model') class ControleHonorario…
-
0
votes0
answers36
views -
0
votes0
answers17
viewsHow to send an Emit to a certain ID on the websocket
I was making a matchmaking system for my online game, and I needed to warn these two users that they connected via this system, and the most effective way I thought, was to filter these users via…
-
0
votes0
answers19
viewsProblems when injecting DLL with Node.js
I am trying to inject a dll into my Node.js application but can’t progress would like to know if anyone can help me? Application code var edge = require('edge-js'); var Dtef = edge.func({…
-
0
votes1
answer52
viewsHow to get the notificationCode from the Pagseguro notification URL?
In the details of the notification I have: The following parameters were sent via POST: notificationType=transaction notificationCode=D666218281808180F60334A66F8340B434F9 { "request": { "url":…
-
0
votes0
answers20
viewscsv file being downloaded with null content - Angular 9
I have a code that makes a request my api in Node that returns me a csv file, but when I download the file, it comes only with null content generateReport() {…
-
0
votes1
answer49
viewsDeploy Node application in Heroku with ES6 modules?
Speak, devs! Following... I would like to know how to deploy a Nodejs application using ES6 Modules In my package.json I am using so: "type": "module", ... "scripts": { "test": "echo \"Error: no…
-
0
votes0
answers26
viewsRECURSIVELY INCLUDE CONTROLLERS IN NODE.JS AND EXPRESS
I’d like to know how to import all controllers from a project automatically. below I leave an old code I found on the internet that shows how to do // routes/index.js var fs = require('fs'),…
-
0
votes0
answers39
viewsHow can I validate the multer so that it does not save the image in the Storage if the database validation returns false?
const multer = require('multer'); const path = require('path'); const crypto = require('crypto'); const aws = require('aws-sdk') const multerS3 = require('multer-s3'); const s3 =…