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
answers154
viewsWhat is the recommendation for the Mysql Connection Pool in Nodejs?
According to the documentation of mysql for Nodejs, it is possible to configure a connection pool to limit the number of connections in Mysql When running the following command on my Mysql server:…
-
0
votes1
answer383
viewsData formatting in Node.JS, with Sequelize and Moment.JS
I would like to format a date that is being loaded from the database with Sequelize. I’m blogging and I need to get the article creation date My route: app.get("/", (req,res) =>{…
-
0
votes1
answer14
viewsError while capturing Tinyurl shorten method
I need to capture the return of the method shorten library TinyUrl. I’m trying to store this return in the variable shortUrl and then save to the bank as follows: import TinyUrl from 'tinyurl'; let…
-
0
votes0
answers27
viewsI would like to make a relational query with sequelize type right Join
I need to perform this type of query with sequelize, for a specific data return. "SELECT p.id, p.nome , p.numero_face, zp.zona_id from pessoa as p right join zona_pessoa as zp on zp.pessoa_id = p.id…
-
0
votes0
answers29
viewsWarning on Reactjs routes
I have the following custom route configuration <BrowserRouter> <Switch> <IntroducingLayoutRoute exact path="/" component={Main} /> <IntroducingLayoutRoute path="/about"…
-
0
votes1
answer214
viewsTest error with Jest and Supertest
Good afternoon, you guys; I created my tests with Jest and supertest, and they are giving an error "Object.is Equality", Versão Node: 12.18.3 Versão NPM: 6.14.4 Versão Yarn: 1.22.4 ps: I am using…
-
0
votes0
answers281
viewsConfiguration of . htaccess for Nodejs and React application using the same domain
Hello, I am configuring an application on a cPanel server. The backend was developed in Node JS and will be published in a URL with the following format: https://teste.com/api; The frontend was…
-
0
votes1
answer130
viewsHow do I delete the image before it is uploaded using Multer?
I’m having some difficulty with Javascript and Nodejs. I’m new to them. I made an application in React Native and the person can choose to delete their profile image. There are also images in the…
-
0
votes0
answers23
viewsIn Gulpjs, how to generate folders separated by file by "Gulp.dest()"? As if it were a widget?
I’m trying to solve a problem that so far I haven’t found a good solution. In my front-end project with Gulpjs, I am using the package Gulp-file-include to include HTML blocks and generate another…
-
0
votes1
answer493
viewsQuery using Sequelize resulting in "column "id" does not exist" error
I am testing the REST API I am developing. I am using Sequelize and Postgresql. In the API there is the table users with the following fields: user_id user_nickname user_fullname user_password…
-
0
votes0
answers31
viewsI’m not able to solve npm dependencies
to receive this output when trying to use the npm i Movie-trailer command, vscode does not recognize the library. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]…
-
0
votes0
answers37
viewsHow do I access the value of an object in the view with handlebars when that object was created within a controller?
I created a controller file that has an object with some items being one of them a function that returns files from a folder. When giving console.log an array is returned with the files from this…
-
0
votes1
answer224
viewsNodejs: How to make a 'system("pause")' or 'Readkey()'?
I’m running a JS code using Sublime Text, cmd automatically closes after executing the JS code, so I don’t see the results so I thought I’d use something similar to the system("pause") function or…
-
0
votes2
answers108
viewsAccess variable item in JSON using Node.js
I am accessing an API using Node.js, which returns the following JSON to me. I need to access the field price, however the item PETR4: varies according to the symbol informed. I can access until…
-
0
votes2
answers124
viewsHow to update some fields of a table
I am using the framework based on Java Scrit and Nodejs,Adonisjs.Need to update some fields in a table. Table fields user need to be changed, by default they come NULLS. The fields are…
-
0
votes1
answer419
viewsBad Request 400 - Using Fetch API
I’m having trouble accessing my api using POST method. This is my requisition: function createTool(token, obj) { return fetch(`${url}/tools`, { method: 'POST', headers: { Authorization: token, },…
-
0
votes0
answers118
viewsFs.Promises does not exist
I was setting up an app when I came across the following mistake: The interesting thing is that I use the same function in another application and it works normally. I wonder if you have ever come…
-
0
votes0
answers107
viewsProblem with CORS even after setting header for Access-Control-Allow-Origin
I have an app Vue staying in the Netlify and always when I try to achieve a request of the kind POST in my endpoint https://backend-app.herokuapp.com/clientes I get the following error: Access to…
-
0
votes1
answer797
viewsHow to get an answer that is in the request header
I’m making a site that contains a forum and I need to pick up the amount of topics and registered users and with this in my back-end I send these quantities by header. I’m using in my back-end Cors,…
-
0
votes1
answer118
viewsMake a function that takes a string with numbers and returns the highest and lowest value
Your function will receive a string as parameter. Separate this string using the ' ' character and return a string containing the largest number and the smallest number (necessarily in this order).…
-
0
votes0
answers43
viewsI can’t return any information or send it to the database (javascript, Node, sequelize, postgres)
Good afternoon, you guys! I am doing this project of registering classes with login screen, admin user etc. and I am currently assembling the back end of the project. The goal is to create a day and…
-
0
votes0
answers68
viewsHeaders on GET request with SWR
Good morning guys. I would like to know how I can pass headers on a GET request with the SWR. My need lies where I need to show all the registered products of a company, where the ID of this is…
-
0
votes0
answers62
viewsI can run the local code, but not on Heroku
When I run this code locally everything goes well, and is returned to the Instagram page. However, when I deploy to Heroku I can no longer execute the code because an error appears. I tried to…
-
0
votes0
answers34
viewsTypeerror: Cannot perform 'get' on a proxy that has been revoked
Hello I am having trouble working with asynchronous Node mode with Bot Framework 4. When trying to execute the code below, it generates the error: Typeerror: Cannot perform 'get' on a proxy that has…
-
0
votes0
answers11
viewsProblem with the shh2 library
Hello, I am developing a project in order to create a server sftp own, so I preferred to use the ssh2 library, however, I am having a problem, when sending a file with a directory mode are not all…
-
0
votes1
answer191
viewsRun javascript function in parallel
Guys I’ve seen some questions but I did not understand well to be sure, after some researches I saw that it was possible to do this using Promises! So I took a function on Google and I modified some…
-
0
votes1
answer187
views400 Bad request on express and typeorm server
Hello, I’m trying to create a user, but when sending the post method with the user data I get one 400 Bad Request server, the problem is that the server is not understanding the data, in the error…
-
0
votes1
answer94
viewsAccess denied when I put two roles on routes using Adonis Acl
Hello, I’m trying to get the administrator and the patient to access some of the routes in my system. But the structure only works when I put only one roll in 'is:(administrador || paciente)' at the…
-
0
votes0
answers82
viewsSend an external API token with request in Node.js
I’m new to Node.js, I have a question maybe easy to resolve... I have an Node.js application that communicates with external API in php, send and receive information through tokens, and I found a…
-
0
votes1
answer249
viewsUpdate user photo data with nodejs and Typeorm
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from 'typeorm'; import Doctor from './Doctor'; import Patient from './Patient'; @Entity('images') export default class Image…
-
0
votes1
answer356
viewsDiscordapierror: Invalid Form Body DICT_TYPE_CONVERT: Only Dictionaries may be used in a Dicttype
I am making a bot for Discord with Node.js and Discord.js. When I went to make the error command, the error that is in the title occurs: Discordapierror: Invalid Form Body DICT_TYPE_CONVERT: Only…
-
0
votes1
answer66
viewsDoubt about the body of the requisition
I was doing some tests and I realized that when sending a parameter with single and double quotes, an internal error occurs. Ex: password: teste'" Error: SyntaxError: Unexpected token i in JSON at…
-
0
votes0
answers16
viewsImporting CSV with Nodejs Problems with CSV first column
Good evening guys, someone has already had the problem in importing a CSV where the first column of the file comes as Undefined? // import_customers_service…
-
0
votes1
answer100
viewsJavascript function making nodemon run in loop
I made a function that works when run from node app.js, but when I run with Nodemon it starts and reboots forever. The function in question is used to write a JSON to a file. I need to use Nodemon…
-
0
votes0
answers191
viewsUsing React, Typescript and Nodejs. I need to login and logout users
Frontend import React from 'react'; import { Link } from 'react-router-dom'; import Header from '../../components/header/header' import './login.css' import loginImage from…
-
0
votes0
answers16
viewsUnexpected behavior in javascript unstructured swap
Good morning, I saw about allocation via structuring and swap on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Atribuicao_via_desestruturacao, but I saw that if I make…
-
0
votes0
answers64
viewsbcrypt.compareSync always returning false
I am creating an api for reasons of studies, and I have a problem that bcrypt keeps returning false for what it seems to me, I used this same comparison function in another study project and it had…
-
0
votes1
answer80
views -
0
votes1
answer39
viewsI am having a problem loading a Multer image on the server, the file loads to the path but not to the database
On my machine works perfectly, the image is loaded to the path and all data to the database but on the Ubuntu server with the same code and the same database only the image is loaded to the path and…
-
0
votes0
answers63
viewsSum all records from two different tables
I have two different tables: Entrances and Exits. Each table has columns motive and value I am using Typescript and Typeorm, and the Controller to list both is as follows: class SaidaController {…
-
0
votes0
answers18
viewsError 404 when sending link
good afternoon my dear, I am having a problem here, I am using apache2 and nodejs for the development of a website, www.ecofotoextensaouniversitaria.eco.ufrj.br the site and its navigation works…
-
0
votes1
answer124
viewsHow to calculate the response time of a Node application?
How to calculate the response time of an application in Node.js ? Without much delay only the request being made outside and a method that returns time through the Date.now() Example: Web…
-
0
votes1
answer32
viewsHow to make a recursive model relationship in Nodejs (Adonis)?
Hello, I’m having a doubt that I haven’t found anywhere yet (or didn’t know how to look). In Laravel/Cakephp I can easily relate models and make queries with models recursively. How can I make with…
-
0
votes0
answers13
viewsRecord the fastfycookie module in nestjs tests
Good morning, I am using nestjs to develop an api, Nest is already integrated with jest, I need to register the fastfycookie module in the test module as well as it is registered in Mains.ts…
-
0
votes0
answers37
viewsI am having a Favicon Error H10 in the Nodejs Application Backend Deploy Heroku
Knexfile code: module.exports = { development: { client: 'sqlite3', connection: { filename: './src/database/db.sqlite' }, migrations:{ directory: './src/database/migrations' },…
-
0
votes0
answers153
views(Discord.JS) - Reaction Role error: "Cannot Read Property "roles" of Undefined"
I am trying to make a "Reaction Role" command so that members can receive certain positions. Currently, I use this code: client.on('raw', async dados => { if (dados.t !== "MESSAGE_REACTION_ADD"…
-
0
votes0
answers12
viewsUsing express with Bunyan (logs)
I created a logger with two streams for two different apps as an example: const bunyan = require('bunyan'); const {LoggingBunyan} = require('@google-cloud/logging-bunyan'); class bunyanLogger {…
-
0
votes1
answer1903
viewsCannot destructure Property `name` of 'Undefined' or 'null'
for some reason my req.body is returning Undefined, even with the correct middleware. Controller import { Request, Response } from 'express'; import db from '../database/connection'; class…
-
0
votes1
answer45
viewsNode JS - Function with Return does not pass data
I’m trying to make a very basic API, to learn, but I can’t understand why the return of a function that takes data from BD does not return it to the other module. I’m wearing Knex and ES6: This…
node.jsasked 3 years, 10 months ago Paulo Santos 1 -
0
votes0
answers26
viewsDoubt autocannon working
I have read several times the autocannon documentation, but when I look at the result tables I cannot understand. In the first table, the second column shows 2.5%-5ms. Does this mean that 2.5% of…