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
answer28
viewslocate index where a value is within the limit of two values of the array
var current = 241; var array = [ { start: 236.6, end: 239.42000000000002, value: 'hello word' }, { start: 239.42000000000002, end: 243.58, value: 'bar' }, { start: 243.58, end: 246.12, value: 'X' }…
-
0
votes0
answers332
viewsHow to resolve MSBUILD : Node.js error MSB3428
I’m trying to install a package located in the directory I’m with the command npm install Node.js, but after installing some of the packages I get the error: npm install error - MSB3428: Could not…
-
0
votes0
answers62
viewsI cannot run a query inside a socket event using Node.js (socket.io), why?
Follow what I did initially: var http = require('http'), express = require('express'), mysql = require('promise-mysql'), mysql2 = require('mysql'), parser = require('body-parser'), path =…
-
0
votes1
answer78
viewsGet data stops with Node.JS
I’m trying to get information sent via POST in Node.JS, thus: I call the API that: $.ajax({ method: 'POST', url: '/api/post', data: { xml: '<?xml version="1.0"?><query><author>John…
-
0
votes1
answer52
viewsGet back empty nodejs + firebase
Personal I need help with a get return with Node and firebase. receive an empty array. but in the console.log inside the foreach prints correct [ { cnpj: '03052164798-000179', address: 'Av Duque de…
-
0
votes1
answer73
viewsHow to use open cv with nodejs in production environment
I have an application developed in nodejs in which I use the opencv4nodejs which allows you to use the opencv library in nodejs. The application is ready on local server, but I have no idea how to…
-
0
votes1
answer276
viewsAllow requests only for a specific Nodejs route?
I’m trying to create an API gateway, which is going really well. However, when trying to get a microservice to accept ONLY requests through the gateway, I am having trouble. I want any external…
-
0
votes0
answers51
viewsProblem installing flash package from express via npm
I’m having trouble installing middleware packages flash express. I can’t install any of the packages, either flash, connect-flash or express-flash present the following error at the prompt: Someone…
-
0
votes1
answer139
viewsUnexpected token node error
I’m having trouble using http to make a call on a API. "{\"error\":\"Unexpected token d\",\"code\":400}" const express = require('express'); const router = express.Router(); const http =…
-
0
votes0
answers83
viewsMongodb error - geoNear "in geo indices"
To get a Mongodb database use the following code: router.get('/multibancos', function(req, res, next){ MB.aggregate().near({ near: { type: "Point", coordinates: [parseFloat(req.query.lng) ,…
-
0
votes1
answer42
viewsAngular4 method edit
I started in angular4 a little while, I need to take the information of a field and pass to the screen of Edit, I already have this information in a console.log of the screen Dit that I put to test,…
-
0
votes1
answer110
viewsfind no req.body using populate
Controller async index(req, res) { const avali = await Avaliacao.find(req.body) .populate('Time').exec((time, err) => { console.log(`Para retorna tudo ${time}`) }) return res.send(avali) }, Model…
-
0
votes0
answers36
viewsData Issues Node.js (SQL Data)
I have a question regarding receiving SQL data in a Javascript array. I have the login information and everything, related to the server, but the issue is not the connection, is to save the data in…
-
0
votes1
answer565
viewsNodejs, express, browser does not find files
Good afternoon guys, I made an API with Node and I consumed it with React, in development environment, works OK because I start one independent of the other, but in production I’m trying to deliver…
-
0
votes1
answer868
viewsRequest Application/PDF generating file with wrong information[Angularjs+Nodejs]
I have an Angularjs+Node(Express) application totally Restless. The back end only serves to validate requests and route to other applications, holders of business rules. At some point, my front…
-
0
votes0
answers37
viewsNpm install problem when deploying to the server
I developed a site using Vue and Node, both fully functional on my machine, when hosting the backend on the web server (I used Kings host) and trying to run npm install to install the dependencies…
-
0
votes1
answer49
viewsDebbuging no Node js
How do I return the vscode debug to the Node default to see the variables and breakpoints on the server side? Because I once ran the debbuger for Chrome and now he doesn’t even ask what environment…
-
0
votes1
answer248
viewsSend Object array as Ajax parameter
I have an array of objects composed as follows: {file: File(871699), x: 0, y: 0, width: 2, height: 2, …} Each vector box has an element as described above, and the first parameter, the file is an…
-
0
votes1
answer57
viewsUpdate method does not update in the database
With a problem when editing, when I click on the button it looks for the information of the fields in the console.log, already has the ID on the route also the problem is that it does not update the…
-
0
votes1
answer850
viewsReceive and send value with Nodejs
How to receive inputs with nodejs and send a value to a given page element? Example: const fs = require('fs'); const http = require("http"); http.createServer((req, res)=>{…
-
0
votes1
answer550
viewsQueues (queues) are useful in Node.js, which is asynchronous?
I know that in languages like PHP, queues (queues) are often used to perform more "heavy" actions, such as sending a series of emails and the like. Therefore, taking into account the asynchronous…
-
0
votes1
answer260
viewsProblem with Success message after registration of 2 inputs in the bank!
Hello, I have a problem in my code, after registering 2 inputs should appear a message of success in uam green div, but only appears the green div and the message no, already revised the code…
-
0
votes1
answer30
viewsHow to check two variables
Good evening, I made this program only for tests, I wonder if there is how I add the nota2 as second variable and how it would be checked together with not function calculaNota(nota1) {…
-
0
votes1
answer399
viewsUpdate object array in Mongodb with Node?
Good evening, everyone. I’m developing a simple chatbot for testing purposes, but I ran into a problem. I have a user, when starting a conversation, a bot is generated, and this bot has an array of…
-
0
votes0
answers104
viewsDoubt in an error Node.js
I’m starting to do projects with Node.js, but I don’t understand why my code isn’t generating the view, and I don’t think it’s storing the data in sql. function Funcionarios (connection) {…
-
0
votes1
answer76
viewsEscape symbols in Nodejs
I have the following code running on Nodejs /*jshint esversion: 6 */ const express = require('express'); const bodyParser = require('body-parser'); const app = express(); const port = 8080;…
-
0
votes1
answer218
viewsBotpress installed one version, displaying the other at the start of the application
I’m trying to run version 10 (develop/x) of botpress, but every time I give start he displays the version 1.1.13 root@3900662b3eb1:/bot# bp start 18:49:25 - info: Starting botpress version 1.1.13…
-
0
votes0
answers506
viewsVisual error Studio does not recognize language
I have a problem with Visual Studio Code. I installed the Node.JS, then the VS Code and soon after the code Runner. However, the VS Code is not recognizing the commands. Digito console.log("texto")…
-
0
votes0
answers45
viewsvsCode Error - Unrecognized language
Can help? Cod Runner and Node installed.
-
0
votes1
answer693
viewsSend the contents of a front-end function via POST to Node
Hello, I would like to know how to send a variable within a function via the POST method from the front end to the back end, and receive the value on the POST Express route? In the Frond-end…
-
0
votes0
answers330
viewsUrierror: URI malformed in Nodejs
Server-side code const bodyParser = require("body-parser"); const express = require("express"); const app = express(); const port = 8080; app.use(bodyParser.urlencoded({extended: false}));…
-
0
votes1
answer839
views -
0
votes0
answers188
viewsHow to call the Federal Revenue API with Javascript?
I am creating a REST API and when registering the company I would like to inform only the CNPJ, so use the WS revenue to bring the company data. I’m doing it this way: const Empresa =…
-
0
votes0
answers51
viewsreturn javascript asynchronous method values
Hello I have a problem here, I need to use the Node request module, twice. one to take the link from one page and the other to take the content of a post. in this way, I have the following problem:…
-
0
votes1
answer36
viewsUpdate exported property in nodejs
I’m passing my app made in electronjs (nodejs) to the MVC standard and found a problem when updating an exported property. Example of my application.js: // Importa os módulos privados const config =…
-
0
votes2
answers662
viewsModel, Express and the Mongoose
I have the following code in express.js const express = require('express'); const load = require('express-load'); module.exports = () => { var app = express(); var bodyParser =…
-
0
votes3
answers1776
viewsHow to show error returned from backend in nodejs in React
I have a problem showing the error message that came from the backend. I return in the backend: res.status(400). send({error: "User already exists"}); already on the front I would like to display…
-
0
votes1
answer547
viewsIs there an equivalent php strpos() function in Javascript?
I would like to know if there is a php strpos() error function in javascript on mainly for the Node.js environment and would like to know how to use it.
-
0
votes1
answer544
viewsHow to return a specific status with Adonis.js/Node
I am trying to return a specific status and a message in my api, I tried this way: return response.status(409).json({message: 'User already registered'}) But I’m getting: Response is not defined I…
-
0
votes1
answer35
viewsScript in Firestore (Firebase) does not arrive at update
I’m having trouble with the code below. The code reaches postbackRef.add and adds the information in the database, but after that it does not enter transactionsRef.Where to perform the update just…
-
0
votes1
answer1272
viewsHow to search and update data with Mongoose?
I’m using mongodb with Mongoose in nodejs, I have my schema like this: const UserSchema = new mongoose.Schema({ username: { type: String, unique: true, require: true }, balances: { dolar: {…
-
0
votes1
answer973
viewsIs it possible to add Node script data to html?
I am quite beginner under the Node.js, but wanted in humility to understand why a code only appear on the console.log of Node and not be able to store in some variable so that I can manipulate it in…
node.jsasked 6 years, 6 months ago Henrique N. Mendes 328 -
0
votes1
answer46
viewsDoes anyone know why the list remains empty even after await (Node.js)?
static async readAll(){ const data = [] await mysql.query('SELECT * FROM registro', (err, result, fields) => { if (err) throw err; result.forEach((doc) => { const registro = new Registro(doc);…
-
0
votes1
answer48
viewsUpdate of an installment form query
Good afternoon, today I had a little doubt. Somewhere in my code I have a query to do an update. The function is as follows: function updateUser(user_id, params) { const query = `UPDATE users SET…
-
0
votes0
answers39
viewsMy Lightbox module that I inserted in Angular does not work, how to do it?
Well I installed this Lightbox module with the command npm install lightbox2 --save according to the website: lightbox so far so good. After I put the paths in the angular file-cli.json as examples…
-
0
votes1
answer79
viewsHow to make an array of arrays for a multiple Insert in mysql with Node?
I need to make a multi-value database, for that I need a array of array. The first value of each array will be fixed and the second element I will change with a is probably: var values = [ ['281',…
-
0
votes1
answer768
viewsGet the logged-in user id of a nodes.js session
I am using the Passport with Session and need to get the user id of a session. I tried to use: router.get('/', (req, res) =>{ execSQLQuery('SELECT * FROM users WHERE id=' + req.user.id, res); })…
-
0
votes0
answers78
viewsJavascript, ajax request return, generate file
newXHR.addEventListener('load', reqListener); newXHR.open('POST', 'http://nfse.vitoria.es.gov.br/aberto/op/imprimirNfe.cfm', false); var jsonData = { codNfe: vlNota }; var formattedJsonData =…
-
0
votes1
answer32
viewsMultiple Prototypes
I would like to know how to add a prototype to a function that is already instantiated in a prototype. Example below: app js. 'use strict'; function NivFire(){ this.db = "", this.admin = "",…
-
0
votes2
answers623
viewsRegular expression for dynamic URL
I have an html file with urls in this URL pattern: https://www.olympikus.com.br/tenis-olympikus-flower-415-feminino-cinza-D22-1131-010 The standard is protocolo://dominio/strig-dinâmica-000-0000-000…