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
votes2
answers10099
views'npm' is not recognized as an internal or external command, a operable program or a batch file
Good evening! I have this problem. I have tried some things I found on the net but nothing has worked so far. npm is installed ([email protected] C: Program Files nodejs node_modules npm) and PATH (C:…
-
0
votes1
answer211
viewsHow to establish SSL/TSL socket connection with Nodejs
I created a very simple server socket with Nodejs (V8.11.3) and it is working OK apparently. My goal is to keep an open socket connection continuously with an electronic device (Iot). QUESTION: How…
-
0
votes1
answer4776
viewsDiscord.js sending user-programmed private messages with a scroll
Hello I don’t know if anyone is aware of Discord.js but I’ll ask anyway I am making a small student guide, IE, something that can warn the student of what is happening in their school life What I’m…
-
0
votes1
answer79
viewsCrashing app for no reason - Ionic 4
I am making an application (Ionic4, typescript, Node.js) for recording and playing audio where the user records the sound and after the audio is presented with a play button; Soon after the user…
-
0
votes1
answer68
viewsLoad scss from js file
I am working on a static website, where I have the following directory structure: / /src exemplo.scss exemplo.js index.html webpack.config.js In my exemplo.js i give a require('exemplo.scss'), which…
-
0
votes1
answer199
viewsPromises Sequential - Node
I am trying to create a string of sequential Promises in Node.js and it is not running one at a time but all! You should perform as follows: Promise1 -> (then) -> Promise2 -> (then) ->…
-
0
votes1
answer69
viewsSearch between two values
Well I need to do a search on a collection where I have XI, XF, YI e YF I will send for example x:10, y:9 so I need to identify which location items satisfy that location. Given the items saved in…
-
0
votes1
answer162
viewsSerialport node reading data without line break
I am working on a project with serial data reading, using the Node Serialport library, but when printing the data on the console I have the data broken in several lines, example: send = "1000", I…
-
0
votes1
answer373
viewsHow to dynamically assign the selected value of a select with ejs?
Is being sent from the server to this view an object with some information and among them are the values I want to assign to each inputs select, but I cannot assign. I am using ejs as my view…
-
0
votes0
answers185
viewsDo not create table in API, use the one I have
I made an api on nodejs that the models is: 'use strict'; module.exports = (sequelize, DataTypes) => { const RESP_CC = sequelize.define('RESP_CC', { RCC_RESP: { type: DataTypes.STRING(6),…
-
0
votes2
answers500
viewsJavascript does not work on Nodejs
I have an html page that takes some functions of a Javascript page, but when I open this page by Nodejs javascript does not work. I did the test with simple Javascript and Jquery commands, but both…
-
0
votes2
answers375
viewsOpen javascript in handlebars
I’m making a system using Handlebars on Nodejs, when I try to get my javascript code for it, it doesn’t find it. The solution I found was to send my javascript as a page by Node and then pick it up…
-
0
votes1
answer655
viewsStore app.post nodejs request data
Speak people, I would like to know how I can use the data received from the page to use outside the app.? var SerialPort = require('serialport'); var Readline = SerialPort.parsers.Readline; var…
-
0
votes1
answer279
viewsFormat the date with express-handlebars in Nodejs
good night. How do I format the date that comes from the database using express-handlebars? Follow my code below: app js. const handlebars = require('express-handlebars) // Handlebars…
-
0
votes0
answers26
viewsPopulating select with data sent from controller and trying to save to BD
I am sending to form an array to popular select so, controller that sends to the view: const novaForm = async ({ Maquina }, req, res) => { const maquina = await Maquina.find({status: 'livre'})…
-
0
votes2
answers58
viewsHelp Require Node
It all starts when I try to receive a JSON from the CNPJ API, I am using Node and consequently NPM and thus using AXIOS to receive JSON. Okay, all right until then. However, I want to take the json…
-
0
votes1
answer234
viewstake data in the method post
I’m sending an angular object, but I’m not getting the data on the express Node method sent with angular. this.appService.getcheckout(this.post()).subscribe(checkout => { this.log = this.log+…
-
0
votes2
answers2574
viewserror in post request using server-side buttons
Good afternoon, I am creating a function in an api that will make a request via post, I did using fetch on the page with reactjs and now I have to migrate to the api but when making the request it…
-
0
votes0
answers50
viewsI cannot access the text that is inside an object array in Mongodb after applying foreach
I am unable to access my array of objects that have been configured in my Schema. Schema using foreach. const quizSchema = new mongoose.Schema( { question: String, answers : [ {first: String},…
-
0
votes1
answer1095
viewsNodejs and Mongo DB - Unhandledpromiserejectionwarning: Mongonetworkerror: Connection 4
I have the following connection code with Mongodb, it was working perfect, but now gives an error. const express = require('express'); const mongoose = require('mongoose'); const path =…
-
0
votes2
answers295
viewsJavascript variable inside the EJS tag
How to place a javascript variable inside the EJS tag? For example, I wish to make a for by EJS and a if comparing: <% for (var i = 0 ; i < objeto.lenght; i++ ) { %> <% if…
-
0
votes1
answer3740
views"Referenceerror: Document is not defined" in querySelector
I’m running some tests here and I’m making a mistake: The index.html: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>teste</title> <link…
-
0
votes1
answer394
viewsHow to consume an authenticated service with Oauth2 on Nodejs?
I am trying to implement Oauth2 authentication in a REST Nodejs application with Express + Passport. My REST Nodejs application will be an API for a service to be consumed by a mobile application,…
-
0
votes1
answer66
viewsHow to return a variable from an attached form?
''' I want my code to return a value/string from that form: <form action="/dashboard/busca_inserir" method="POST" enctype="multipart/form-data"> <div> <label…
-
0
votes1
answer238
viewsSearching and subtracting dates
I am new in the area and would like to put a difficulty that I am having .. In the Mongo database I have an example table (returning this json) { "_id": "5cb7652fc278309ac78dce2b", "status": "Teste…
-
0
votes1
answer202
viewsHow to bring a BD result with NODE.js into an array
Personal how do I amaze, data that is in the database, in an array, with NODE.js? I have this value this values in the database: Column 1 (linha 1)Fortaleza – Caucaia |(linha 2) Fortaleza –…
-
0
votes1
answer254
viewsBlocked cross-origin request when creating a box
Hello I’m starting in React and I came across a problem, I’m trying to make an app similar to Dropbox, on the main screen you create a box and can upload files, but when I click create this message…
-
0
votes1
answer705
viewsError in the request
Hello I have a small problem and the following I am creating a firebase cloud Function that makes a request here the code: const functions = require('firebase-functions'); var axios =…
-
0
votes0
answers128
viewsError while doing query
I am building a Rest api with Node, but when trying to get a pass parameters returns all the data. app js. const express = require('express'); const app = express(); const mongoose =…
-
0
votes1
answer403
viewsConsume API with Javascript and save data in Mongodb
Hello, Currently I have an application that Backend is in PHP and consumes a JSON API. Through the query I can save the data in my Mysql DB. I want to know if it is possible to do this in…
-
0
votes1
answer242
viewsCatch second row of a table
I’m developing an application using Node.js and puppeter to take data from a web page, the problem I have and that I’m not getting the columns I want inside the selected row, this is the part of the…
-
0
votes0
answers214
viewsHow to change the Adonisjs hash to md5?
Hello, I am developing an api on top of a legacy project used by other systems, and I intend to perform an authentication using md5 instead of bcrypt to compare the password only. There is already a…
-
0
votes2
answers181
viewsMongoose error or nodejs
I’m developing a simple script, but I’m stuck in an error that I can’t understand the reason, I created a model and apparently the error occurs whenever I try to access. Node:…
-
0
votes1
answer131
viewsGlobal variable inside require Node.js
I have the following function: function album(music){ var album; request('http://localhost/socket/source.php?music='+music+'', function (error, response, result){ data = JSON.parse(result); album =…
-
0
votes1
answer221
viewsYou need the id for 'params.id' on the route and I already have the id in auth.user.id? Adonisjs
I have the following question when creating my user’s Routes and Controller. I see that when I create the route with Route.Source automatically Adonis creates the CRUD routes and passing the ID in…
-
0
votes1
answer34
viewsI do not understand and do not know where to find this information
const mongoose = require('mongoose') const Schema = mongoose.Schema let transactionSchema = new Schema({ userId: mongoose.SchemaTypes.ObjectId, transactionDate: { type: Date, required: true },…
-
0
votes1
answer452
viewsUse proxy in nodejs to access external files
I have a service on Nodejs that does a fetch to access an external api: const express = require('express'); const middlewares = require('./middlewares/middlewares'); const routes =…
-
0
votes0
answers39
viewsError: No Access-Control-Allow-Origin
[HELP] I am not being able to access my server’s JSON; I’m using this code to access, when I use the urlSrt, it returns me normally, (it is a site that receives a cep and returns a json with the…
-
0
votes1
answer49
viewsIs importing module into the loop a bad practice?
Good morning guys, I have a javascript module and I import it at the beginning of my main/main code and I run a foreach, still in this main code has loop that calls the methods of the module:…
-
0
votes0
answers119
viewsPromise inside Premomise does not wait Axios
Eae guys I’m having a problem, I get several objects where I mapped them, make an external query using the Axios and save your return. Let’s go to code: let savedClients =…
-
0
votes0
answers150
viewshow to make javascript take an n number of elements from a database
I would like to take for example all the names of a database table and save in an array(or matrix) and then list in an html table how can I create a new method BS: I have that part ready: var mysql…
-
0
votes1
answer322
viewsTake only one value in the query result to the database
I’d like him to pass one return with only the number of data of that table, however it is returning it: C:\E. S>node dao.js Connected! [ RowDataPacket { 'COUNT(*)': 4 } ] Code:…
-
0
votes1
answer229
viewsNodejs send server files to server
Good afternoon, my friends, I am trying to send a file from an application of mine (in Node) to a web server made in PHP. But it is returning the message saying that the file parameter (arqCsv) was…
-
0
votes1
answer127
viewsDeploy Heroku Error - Node.js
This is Galera, all right? So I’m deploying a Heroku app that had no connection to Mongo, it was online, but no connection to any database. I made the connection I tested the requisitions in…
-
0
votes1
answer526
viewsAsync/Await, where are you wrong?
const url = 'http://files.cod3r.com.br/curso-js/funcionarios.json' const axios = require('axios') const busca = () =>{ return new Promise((resolve, reject) =>{ try{ const funcionarios =…
-
0
votes2
answers150
viewsAdd Objects within a Javascript Array
I need to get this result here: [ { alu_id: 10, alu_nome: 'Edson Santana dos Santos', notas: { dis_id: 1, dis_nome: 'Português', nota: 25 } }, { alu_id: 11, alu_nome: 'Larissa Manoela da Silva',…
-
0
votes1
answer176
viewsNode.js execution error
Hello, I have this error in my app: Server Running On! URL: / Method: GET _http_outgoing.js:482 throw new ERR_HTTP_HEADERS_SENT('set'); ^ Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they…
-
0
votes1
answer1859
viewsHow to fix "EPROTO" error after updating Node version?
The following code works in the version v10.15.3: const { post } = require('request'); const { post } = require('request'); post({ url:…
-
0
votes1
answer80
viewsManipulated image slide with database in Node.js
There’s this slide of images in bootstrap, I want it to receive the images from the database (so far so good), but instead of displaying one by one it’s listing all at the same time. that’s the…
-
0
votes1
answer134
viewsI cannot access SQL query property on Node.js
I’m trying to create a code that logs into a website, but when it takes the data from the database to do a check, I get an error. My current code: router.post('/loginClin', function(req, res, next)…