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
-
2
votes1
answer402
viewsQuery in multiple Node + Mysql tables
Taking into account the need to bring the result of a second table, based on the result of the first, how would you do this with Nodejs ? In PHP I would bring the result, and inside a while did…
-
2
votes1
answer170
viewsNode js, promises, callback
I need to run certain updates and delete within a query return in my controller. but only the last function is executed I don’t think I understand how to use promises. api.adMaster = function (req,…
-
2
votes2
answers537
viewsPermission denied on Firebase
I’m developing an app with Ionic 3 and the Firebase ... In the rules of Realtime Database, the problem arises: I try to put the rules pro type "user", but the following error arises : ERROR Error:…
-
2
votes1
answer17
viewsMake remote json into string
As it is possible to return the value of a remote json and read as string, example when I get the json it prints the whole result as in the image below. code below: var https = require('https'); var…
-
2
votes1
answer283
viewsWebpack + Nodejs import bootstrap + jquery
Hello folks from Stackoverflow, I have a Vuejs project already with Webpack. And I was importing the Jquery and Bootstrap libraries. I went to my Ode and used the commands npm install jquery…
-
2
votes2
answers308
viewsError with Electron + Serialport to use Arduino
I’m having trouble running an application made with Electron, Serialport and Node.Js to communicate with an Arduino. I have the following mistake: App threw an error during load Error: Uma rotina de…
-
2
votes4
answers7933
viewsHow to upgrade Node.js from version 8 to 10 on Linux Ubuntu, via SSH?
I tried several tutorials on the internet before coming to post the doubt here on Stackoverflow and no tips worked. My repository is with version 8 of Node and the same, even removing, back. I need…
-
2
votes1
answer900
viewsUsing model.find() with LIKE in Mongoose
I have a function here to do a search on Mongodb using Mongoose, but I would like him to find Brazil when I searched for bra, Bra, Sil, Sil, etc. I looked in the documentation and followed the…
-
2
votes1
answer185
viewsPass variable in Mongodb query (JAVASCRIPT)
With that consultation: const result = await Topic.find( { 'categorieName': { $regex: /^news/i } } ) I can return the categories with name news, the problem is that it is not always news, so I…
-
2
votes1
answer266
viewsWinston Node creates log file but does not save: Attempt to write logs with no Transports
I have a problem in Winston, follow my settings: const logger = winston.createLogger({ level: 'info', format: winston.format.json(), transport: [ new winston.transports.File({ filename:…
-
2
votes1
answer13414
viewsError: "Can’t set headers after they are sent" on Node.js / Express
I have the following method : //USER_POST router.post('/user', (req,res,next) =>{ var obj = {name:req.body.des_name, email:req.body.des_email, endereco:req.body.des_endereco,…
-
2
votes0
answers457
viewsHow do I process a JSON in the event of a request-Promise failure?
I have 2 Microservices, one in Nodejs and the other in Spring. Nodejs contains the domain of events (parties, birthdays etc) and Java the domain of users. When viewing Nodejs event endpoints, I also…
-
2
votes0
answers73
viewsHow to install npm on the Heroku server?
Greeting to all, I recently sent an Laravel project with Vuejs to the Heroku server, and I realized that it did not recognize my App.js file where the methods created by Vuejs are, this file is in…
-
2
votes1
answer33
viewsJavascript object does not create new Keys
I am using Mongodb and returns me all the right data but when I want to add a new Key simply does not create. exports.validaLogin = function(req, res) { login.find({ "nome": req.query.usuario…
-
2
votes1
answer388
viewsPick up music track information with JS
I’m making a music player using only HTML, CSS and Javascript. I can do everything except grab track information. I can get the length of the track and also the current time, the information I need…
-
2
votes3
answers252
viewsDependencies Nodejs
Hello, One thing that’s been bothering me is the amount of dependencies on nodejs projects I’ve seen. What happens if I have a job in a nodejs project and the author eliminates it? How can I ensure…
-
2
votes0
answers535
viewsProblem with Node-Sass
I’m using the Ode 8.9.1 with npm 5.5.1 and @angular/cli 1.5.0. When running npm install I get the following error on the terminal: Downloading binary from…
-
2
votes2
answers3481
viewsRegex for strong password
I want to create an expression that creates a password with: 8 characters minimum 1 Capital letter at least 1 Number at least 1 symbol at least: $*&@# If possible, also do not allow equal…
-
2
votes1
answer50
viewsHow to make a Docker image of a Node app that uses a private file that requires ssh
Following this guide from the Node.js website to create a Docker image for a Node application, everything works except when you have a private repository for a certain npm package, such as the…
-
2
votes2
answers88
viewsProblem with creating a new Angular application
Hello, good afternoon to all of the community. Start a new project to develop an application I’m planning to develop, but when you give the command to create a new angular app, which is: ng new…
-
2
votes1
answer143
viewsTreat Nodejs application for when crash, the server restart alone
I have a Nodejs application that when crashes with some error in the controller the server stops and says that it is waiting to fix the error in order to restart the application. How do I restart it…
-
2
votes2
answers123
viewsDoubt architecture deployment with Elasticsearch?
Hello, it is normal to use Elasticsearch as a direct backend in a web application. Security-related? Frontend (js) -> Backend (Elasticsearch) or Frontend (js) -> your backend -> service…
-
2
votes0
answers487
viewsCalculate file size of a dataURL (cost)
I’m uploading an image to Base64 (dataURL) for an application that uses express. As the user is doing the "cropping" of this image on the front end I found no other way to send but by dataURL... the…
-
2
votes0
answers63
viewsFirebase Function nodemailer Office365
I’m using firebase Function to trigger the nodemailer and send an email. Using gmail I was successful, but Outlook365 does not work. In Transporter I do this way: var transporter =…
javascript node.js firebase nodemailer firebase-cloud-functionsasked 6 years, 5 months ago Leone Azevedo 67 -
2
votes1
answer581
viewsUse require() (or other method) in Nodejs as in PHP
In PHP Suppose I have a constant file, in a root directory, called const.php: define('CONST_1', BASE_CONST_1 || 'Value 1'); define('CONST_2', 'Value 2'); define('CONST_3', 'Value 3'); And another…
-
2
votes2
answers196
viewsHow can I test if a Nodejs Response is still alive
I have a Response from Nodejs(Express), how can I test if he is still alive ? let responses = [] app.get('/', async function (req, res) { responses.push(res) }); setInterval(() => {…
-
2
votes1
answer505
viewsPass variables on all renders
I have an application using Nodejs, Express (and a few more dependencies). I reduced the application to the file below to explain my question: app js.: // Dependências. const express =…
-
2
votes1
answer3054
viewsNodejs / Mongodb: Deprecationwarning: Current URL string parser is deprecated, and will be Removed in a Future version
I’m in trouble in: let options = 'replicaSet=XPTO&readPreference=secondary'; var url = `mongodb://${user}:${password}@${host}/admin?${options}`; Deprecationwarning: Current URL string parser is…
-
2
votes1
answer596
viewsHow to display style and run javascript along with html on Node Js?
I started to learn Ode js, but I face a problem when rendering a project composed of: Html, css and javascript. HTML is uploaded and opens, but css doesn’t work like javascript does. codigo Node:…
-
2
votes1
answer472
viewsStore SQL data in a Javascript array
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…
-
2
votes1
answer3378
viewsOpen CSV file and read its contents
I have the information from the CSV file on console.log back-end, I would need to access this file and read its contents, some hint? This is the code snippet from the back end that receives the…
-
2
votes2
answers1053
viewsHow to install Node.js in its latest version (12.x) from the Ubuntu terminal?
I’m trying to install nodejs on my Linux, but even putting the codes in for version 12.x: # Using Ubuntu curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y…
-
2
votes1
answer630
viewsConfigure API for SQL Server Database
I have an API that I used with Mysql, but I had to switch to SQL Server. Unfortunately I never used SQL Server, I do not know if you need to download something to get. The API was made in JS. The…
-
2
votes2
answers90
viewsValidando fechamento de factura para tipo de compra e venda Javascript e submeter para uma api
I’m a beginner and I’m stuck on the invoice closing validation. I built a list in this format: [ date: '2017-5-9', value: '59.99', type: 'credit', typePag: 1 }, { date: '2017-12-17',value: 'R$…
-
2
votes1
answer672
viewsDoubt Sequelize Node.js
In relation to sequelize i created a table in my pgadmin named TB_USER but I have a question when creating the model: const Sequelize = require('sequelize'); const db =…
-
2
votes2
answers149
viewsFile deletion with Fs not working
I have a if to delete a file, however it is not being deleted and is not throwing errors. Does anyone have any idea? if (results[0].photo != `arquivos/imgpadrao.jpg`) {…
-
2
votes1
answer7851
viewsconsume Rest api with React and render the data in a table
my code: import React, { Component } from 'react' import axios from 'axios' import PageHeader from '../template/pageHeader' import cadastroForm from './cadastroForm' import cadastroList from…
-
2
votes1
answer96
viewsCreating a CLI tool with NODEJS
I am learning how to create a tool CLI (Command-Line Interface Applications) and carried out the following steps: I created a folder and inside it in the terminal npm init--yes with that I generated…
-
2
votes0
answers121
viewsHow to correctly implement an asynchronous counter in Node.js?
I am experiencing difficulties in implementing an asynchronous counter using Node.js and Mongodb. Follows the code: app.get('/', req, res ()=> { var number = await Number.find({}); // Leitura do…
-
2
votes1
answer70
viewsCount of new lines in Node
I wish to count the number of new lines of a file. For this I am doing as follows the reading of the file : const fs = require('fs')//utilizando o módulo fs…
-
2
votes1
answer409
viewsHow does attribution work via disruption?
I don’t understand how the assignment works via unstructuring. It’s something specific to JSON? An example of the body of a request to Node.js: { "title": "Caso 1", "description": "Detalhes do…
-
2
votes0
answers43
viewsSend post parameter to restify
I’m trying to send parameter to nodejs with restify, but it’s always coming undefined I’m sending it sort of like this: $.ajax({ url : 'http://localhost:8080/api', type: 'post', dataType: 'json',…
-
2
votes1
answer410
viewsNode.JS and Express Insert with problem
I am new as Node.JS Express programmer with Mysql, I created the implementation to save, but he create the registry with null in the table, see how I performed the test in Postman; This is my…
-
2
votes1
answer2626
viewsHow to get a URL parameter in Express?
My URL is coming this way http://localhost:3000/menus/5.5 and it’s bringing all the 5.5 records, but I wish the URL could look like this http://localhost:3000/menus?price=5.5 to have the same…
-
2
votes2
answers41
viewsWithin a method belonging to an object, the this of the called function does not point to the object
I have a function: let comparaComThis = function (param) { console.log (this === param) } And I have an object that calls this function: const obj2 = { consta(){ comparaComThis(obj2) } } The point…
-
2
votes1
answer130
viewsThere is a standard documentation/software comments in Reactjs
I’m leading a development team on Reactjs with Node.Js, and I’m having a question about how to document or comment this code so it’s nice and easy to read by other devs. Still commenting code? Sorry…
-
2
votes1
answer630
viewsNodejs query in SQL Server
Hello, guys I need to make a query filtered for days in SQL in a Nodejs application, but during the POST that’s when I filter the Nodejs accuses me of a value conversion error. When running get I…
-
2
votes1
answer139
viewsReplace xml tag with nodejs
Hello, I would like a help to remedy a problem I am facing. I need to rename the tags of an xml file by nodejs. I thought about using regex, using Fs to read the file, but I got a little lost.…
-
2
votes1
answer907
viewsDo I need a server to log in with React?
It may be a silly question but I’m very confused about React.js, I developed a Webapi in Asp.net core and it’s already working... I need to do a login system on React. Thinking about the way I would…
-
2
votes1
answer114
viewsWhat does arroba (@) mean in the name of a dependency on the package.json file?
What is the meaning of the @ symbol before a dependency on the package.json file? For example: { "name": "star-admin-pro-react", "version": "1.1.0", "homepage":…