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
votes1
answer161
viewsCrawler - how to access several pages
I created a code on Ode to search for the version of the system and the name of the municipality of a portal, however I am not able to make it search for the information of another municipality only…
-
0
votes1
answer59
viewsHow to name each row of a url list
I can name every line on the url list, to return the nickname I gave her? Like that was the result: Prefeitura Municipal de Bocaiúva do Sul | PRONIM TB 518.01.07-013 | Prefeitura Municipal de…
-
0
votes1
answer180
viewsMongoerror: Unknown top level Operator: $expr
I’m trying to do this in my code and works perfectly on the localhost but on the Umbler server is giving error. FOLLOWS THE ERROR: MongoError: unknown top level operator: $expr Follow the code I’m…
-
0
votes1
answer1142
viewsDiscord.js block command message in specific channels
I would like users to put commands in specific places (in the commandos room) as I can do this, because as I tried it is giving error client.on('message', message =>{ const prefix = config.prefix…
-
0
votes0
answers98
viewsRecaptcha token validation request returns nothing - Nodejs Request
Good evening, I’m studying bots to automate buying tennis on sites like artwalk and nike through web requests and other automation systems via requests. My problem consists of a attempt to intercept…
-
0
votes1
answer28
viewsError when trying to identify if a string is equal to one of the values of an array
const Discord = require('discord.js'); module.exports.run = (client, msg, args) => { msg.delete(); let type = args[0]; let types = ['available', 'idle', 'dnd', 'invisible'] if(!type === types[0]…
-
0
votes1
answer390
viewsHow to send html form to route Node?
I have to send the information from an html form via POST to a CRUD (Create, Read, Update and Delete) acronym in Node and mongodb, but I’m not getting it. Code: // configurando setup e chamando…
-
0
votes0
answers199
viewsNodemailer: Error: self Signed Certificate in Certificate chain
I am trying to send an email by nodemailer, but the following error appears: Error: self Signed Certificate in Certificate chain. My code: let transporter = nodemailer.createTransport({ host:…
-
0
votes1
answer92
viewsUsing Eslint in VS Code
Hello! I’m a new Javascript student and am discovering the world of code standardization. In short, well my situation, I am using the Eslinter + Prettier combo in VS Code and my question is: Every…
-
0
votes0
answers22
viewsHow do I leave a number int with X number numbers? (Javascript)
I want to know if you have any property in Javascript for case the number is 5, present 005. case 15, present 015.(3 houses) Without using any verification in the code and with the property doing…
-
0
votes0
answers23
viewsHow to identify whether an npm package is thread blocking or not?
I’m using the package Adm-zip on a project in node.js. I wonder if this package blocks Event loop and how I could identify packages that are thread-bloking or not.…
-
0
votes0
answers725
viewsRelationships hasOne and belongsTo in the same sequelize model
Good am using sequelize along with nodejs and I’m having difficulties with a relationship. I have 3 tables where (location, Equipment, Shed, area) where in one location I have 1 equipment…
-
0
votes1
answer105
viewsWhat’s the difference between npm i -g create-next-app for npx create-next-app?
I created a Next.js project and in the terminal appeared the following: A new version of create-next-app is available! You can update by running: npm i -g create-next-app What is the difference and…
-
0
votes0
answers15
viewsLast FM API request limit?
I am using the Last Fm API and wanted to know the limit of requests for me to put a Sleep. If anyone has knowledge and can help, I’d be grateful!
node.jsasked 3 years, 8 months ago Lucas Couto 1 -
0
votes1
answer29
viewsEditing images on a crud
I have a CRUD of products which has the name, price, description and 4 images for each. Adding, viewing and deleting I’ve already been able to do. But the issue of editing is catching me on account…
-
0
votes0
answers35
viewsNPM INSTALL SQLITE3 (Python) error
Good night, you guys! I’ve exhausted my attempts. I installed python 3.9 added in the environment variables, uninstalled the project’s node_modules and package.json installed node_modules again and…
-
0
votes2
answers132
viewsConvert JSON to Array
I have the following JSON: let result = {"0":4,"10":4,"30":6,"60":9,"90":12,"120":15,"150":18,"180":21} I need to convert to Array in the following format:…
-
0
votes2
answers4910
viewsCannot GET /index.html Node JS error
I think the problem is the assignment of routes, something I’ve been trying to do but without success.…
-
0
votes0
answers23
viewsUpload file and use it to export data
I have a file called preload.js, it is the first to be loaded. I need to do a scan and send the result to multiple files when prompted. I tried: module.exports = { online: false, client: client,…
-
0
votes0
answers51
viewsControl of trolley products
Good morning! I’m making a system where the user chooses the products (where there is only 1 unit of each) and he puts these products in the cart. I need to control this cart for a certain time,…
-
0
votes0
answers20
viewsStart http server inside Electron
I wonder if it is possible to start a Rest server within the Electron. I need that while the application is open it is possible to access an http route.
-
0
votes2
answers45
viewsWhy does isNaN(true) return 'false'?
Guys, I was studying but I didn’t understand, because isNaN(true) is 'false', if true is not a number? (I’m Beginner!)
-
0
votes0
answers75
viewsMessage Whatsapp with Nodejs
I did message testing of my server running Nodejs for Whatsapp using the Wbm library (Wbm is an unofficial API to send Bulk messages in Whatsapp), but I understand that is not the right way, so I am…
-
0
votes1
answer29
viewsWhen I define a constant B = constant A and change one of the properties of constant B the property of constant A is also modified?
const a = new Map(); const construct = { nome: 'Nome', alguma: 'coisa' } a.set('Chave', construct); const b = a.get('Chave'); b.alguma = 'outraCoisa' console.log(a) // Mostra Map(1) { 'Chave' =>…
-
0
votes1
answer544
viewsHow to send information from a Javascript site to the NODE.js server
Guys, I have a javascript site where I get information from a Rest API (json) i would like to delete this information to my server (A Node.js that I created that connects to the database) is my…
-
0
votes1
answer48
viewsNode, server send information to page (bank password control, lab...)
Good night! I do not know if it is possible to implement the following situation: I have an html page that is a monitor (it has the last number called), in the second html page, the user can click…
-
0
votes1
answer70
viewsError while escaping an express js url from a middleware
I’m having a problem escaping a Url of the validation of Token. I’m using the lib jwt (jsonwebtoken) to restrict accesses to my api request, but I want to leave the url /imagem/:parametro without…
-
0
votes0
answers21
viewsrender in nextJs
thank you so much for already paying attention here! <3 i in my landgpage, is presented 5 links, such links are saved in an array of Object and in each Object has the 5 links, and each position…
-
0
votes0
answers49
viewsHow to increment an external variable to a callback in Nodejs?
Hello! I want to increment the hierarchy variable, but I can’t do it. Can someone help me? function getHierarquia(id, req, res) { var hierarquia = ""; res.locals.connection.query('SELECT id,…
-
0
votes0
answers34
viewsError validation with Yup
Good evening. I’m trying to perform an error validation with Yup on an API. However I cannot show the error to the end user, as VS Code informs me that the path is Undefined. Follows the code.…
-
0
votes1
answer1437
viewsNODE.JS - Error: Route.get() requires a callback Function but got a [Object Undefined]
In my roters I create: var express = require('express'); var router = express.Router(); var service = require('./../services/users'); router.get('/login', service.login); router.get('/register',…
-
0
votes3
answers57
viewsMap two arrays and delete item not found
I have an api on Node and I have the following situation: I am the master user and create a usuário A to any employee. That usuário A has the permissions Permissions user A…
-
0
votes0
answers13
viewsHow to check if an array has values from another array?
Well, the problem is this, I have a function in which it requires a property permissions array type, inside the function, is a const perms = ['perm_1', 'perm_2', 'perm_3']. Let’s say the user has…
-
0
votes1
answer828
viewsFolder Listing in Node.js
People need to see all the files of a folder and list it, but calm down what I want is to enter the folder and read all the files and list, but if you find a folder enter it and list what is in it…
-
0
votes1
answer138
viewsImage manipulation with nodejs and Ionic
I have an Ionic application, in it I have to send an image converted to Base64 for an api, and the api for the database. I was getting error by the size of the payload, I found on the internet about…
-
0
votes0
answers12
viewsWhat happens when I use the "npm install npm@6" command using npm 7
I have npm 7.5 installing and need to use version 6.0 to use the @angular/cli module. I wanted to know what happens when I use the "npm install npm@6" command and how to use both versions of npm…
-
0
votes0
answers23
viewsAuthentication with jwt
I have a function to protect the route. Use as follows const authMiddleware = async (req, res, next) => { const token = req.header('Authorization')?.replace('Bearer ', '') if(!token) return…
-
0
votes1
answer1399
viewsTypeerror: Cannot read Property '1' of null
I have this problem and I have no idea how to solve, I want to save images in Azure Storage const blobSvc = azure.createBlobService(config.containerConnectionString); let filename =…
-
0
votes1
answer39
viewsFunction does not arrive at endpoint - Ionic 3 + Nodejs API
In an app in Ionic 3 I have this function validarCupom() that when called sends a GET to , if it has the return 200 (OK), then calls the other function setBonificacaoConveniado(). Below is the…
-
0
votes0
answers25
viewsPOST request awaits endlessly
When I add the authentication in the post route and send the request, the request is waiting endlessly AUTH ARCHIVE: const jwt = require("express-jwt"); const secret = require("../config").secret;…
-
0
votes0
answers44
viewsSequelize Upsert does not return to Row
Why the Sequelize is not returning me to Row in the method Upsert? According to the documentation should return Promise<Model, Boolean|null> the option of returning already is true by default.…
-
0
votes1
answer514
views"export 'default' (Imported as 'Chart') was not found in 'Chart.js'
When I give one import Chart from 'chart.js' this error appears on the terminal: "export 'default' (imported as 'Chart') was not found in 'chart.js' And those bugs on the console: Error in mounted…
-
0
votes1
answer112
viewsNode Error When Installing Bootstrap and Jquery
** Angular Live Development Server is Listening on localhost:4200, open your browser on http://localhost:4200/ ** 91% Additional Asset Processing scripts-webpack-plugin wdm : Error: ENOENT: no such…
node.jsasked 5 years, 10 months ago João Roberto Velozo 1 -
0
votes2
answers395
viewsMongoose findone do not return values
Guys, I’m having a problem here that I don’t know what else to try, I’m using express + Mongoose. My model let mongoose = require('mongoose'); let users = mongoose.Schema({}, {strict: true});…
-
0
votes1
answer48
viewsGenerate new Error and get this error in the controller catch
In my API made in Node, i make user creation from a service: exports.create = async(data) => { try { let verifica = await UsuarioModel.findByUsername(data.username); if(verifica) throw new…
-
0
votes0
answers23
viewsHow to get the number of days between two Javascript dates?
Good evening! The database in which I work returns me two dates in milliseconds. How can I calculate the difference in days between the two dates? Example: Data1: 1619226924035ms Data2:…
-
0
votes1
answer23
viewsHow to run WEP API Node and a Reactjs Project on the same machine?
I have running a Web API at the address localhost:3333 and a Reactjs Application at localhost:3000, however when I try to perform some request with fetch the browser returns Cors error. Is there any…
-
0
votes2
answers262
viewsI need help with that ES6 code
I’m trying to get the data that’s coming this way: [ { "name":"JONAS", "languages":["php","javascript","java"], "age":37, "graduate_date":1044064800000, "phone":"32-987-543" }, { "name":"FLAVIO",…
-
0
votes0
answers48
viewsError: Server returned HTTP code: 404
Good personal day I am trying to connect the Google Earth Engine API on my server, however I am encountering the following error. Error: Server returned HTTP code: 404 at…
-
0
votes1
answer320
viewsDoes not run server.js
You’re making this mistake after npm run dev (I’ve installed the Mongo and the npm models you need) npm ERR! Missing script: dev npm ERR! A complete log of this run can be found in: npm ERR! C:…