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
answer112
viewsHow to import existing Packages into the same directory in a Nodejs application
Hello, I am creating a solution that has been distributed across multiple projects and that contains resources shared with each other. My solution is developed in general in Nodejs along with other…
node.jsasked 5 years, 1 month ago LeandroLuk 4,989 -
0
votes1
answer28
viewsHow to use a method without having to import it directly into the file that invokes it?
In one of my files I have the following content: function env(param, defaultValue) { return process.env[param] || defaultValue; } module.exports = { title: env('TITLE', 'valor padrao'), url:…
-
0
votes1
answer354
viewsHow to make a repeat loop wait for a function to be executed,
I have a program that downloads the file that is passed to him, follows the code function Download(arquivo) { download("https://dumps.wikimedia.org/ptwiki/20190801/" + arquivo).then( data => {…
node.jsasked 5 years, 1 month ago mecatrônica com reciclagem 39 -
0
votes0
answers56
viewsAlternatives to File System functions with Node js
While performing a function to open a very large file ,the same returned me this error Error: Cannot create a string longer than 0x3fffffe7 characters at stringSlice (buffer.js:602:44) at…
-
0
votes1
answer8975
viewsError in Node.JS
Guys I’m following a post to start seeing Node.JS and Angular. Apparently everything was going well until the moment I’m going to do the first test, which, according to post, I have to give the…
-
0
votes1
answer1041
viewsProblems creating API with Firebird Database and Node JS
I am studying how to develop an API to query data from a Firebird database. To do this I am using the Node-Firebird, but the connection does not seem to be working. Follows excerpt from the code:…
-
0
votes0
answers81
viewsMy function is not filling the value to return in function
I am developing a test API using nodejs and Firebird and after a lot of struggle I was able to make the bank consultation work. However I am not able to make the function return the values that were…
-
0
votes0
answers133
viewsSimulate Login on A site
This is devs, I’m all day trying to implement a way to login to a site with Javascript, it’s my university website, and I’d like to monitor when new notes are released, so I don’t have to go to this…
-
0
votes1
answer143
viewsRecursive function returning Undefined in Javascript with Node
The recursive function below stops running when it arrives at "if (Sorted) " and the condition is true, as it should. Only it doesn’t matter what I put in to return, she doesn’t return. If I do…
-
0
votes1
answer493
viewsHow to make the backend communicate with the socket.io server
I’m studying about socket. and I have a problem with the backend. I am developing a system that searches for files with certain extensions and shows them on a real-time screen. To solve this I…
-
0
votes2
answers218
viewsHow to pick up ping time with the https node module
How can I perform the ping calculation between client and server using the http/https Node module. NOTE: I use this module specifically because the purpose of the script is to generate log…
-
0
votes0
answers103
viewsReturn callback variable to main function with Node js
I have a primary function that makes calls from other functions within itself, functions that are called have return with callback as shown in the code below async function processarFrase(frase) {…
node.jsasked 5 years, 1 month ago Israell Llopes 41 -
0
votes1
answer1436
viewsHow do I put my scheduled website on Nodejs on the air?
I am a PHP programmer and use the Filezilla for file management, this way, just putting the files inside a specific folder the hosting server looks for the file index and success. In the case of…
node.jsasked 5 years, 1 month ago Gabriel Ribeiro 495 -
0
votes1
answer266
viewsSocketio com Typescript
I am trying to make a Altime application with express ( 4.17.1"), Node (10.12.0) using typescript. Only in the socket that is giving Cors problem Access to Xmlhttprequest at…
-
0
votes1
answer481
viewsExpress Validator in controller
Hello. I use the Validator express in the nodejs and I’m having a validation problem. When I was validating directly through the routes, the validation was working, however, when I implemented…
-
0
votes2
answers251
viewsFailed to create Node pool connection
I am trying to open a connection pool using the oracledb module but I get an Exception when trying to create the pool import OracleDB from 'oracledb' import dotenv from 'dotenv' OracleDB.outFormat =…
-
0
votes0
answers51
viewsDeploy application using --Prod and path strategy
I’m trying to deploy angular application 8 When I use the command ng build --prod --base-href /app/ When I try to run the application on localhost/app The app does not load On the console you have…
-
0
votes1
answer67
viewsInsert data into a Javascript array #NODE ERROR( EMFILE: Too Many open files, open )
I have 3 arrays in my code, INFO, INFOS AND TEST. And I need to make a function check if the position of my test variable is equal to my info variable and if it is equal, the final variable is: In…
-
0
votes1
answer41
viewsRelease url that start one way
I am using jwsonwebtoken and would like to release urls with dynamic ending that is to download files For that I have the following code: import * as jwt from 'jsonwebtoken' import env from…
-
0
votes0
answers118
viewsAuto-fill inputs in the edit form with old data
Well, I’m using Node.js and Mongoose (mongoDB) as a framework for the database. On the front end I’m using handlebars. The problem is that the inputs are empty even passing as parameter the object.…
-
0
votes1
answer435
viewsI close the connection, and can no longer connect Nodejs Mysql
I need to close the connections after the query return success or error, the first time I do the query ok, but then it closes and no longer queries... I have tried to close in several parts of the…
-
0
votes0
answers44
viewsCache error in React-Native for IOS version
I am working on an application inside a new directory, but the emulator insists on calling another application from a folder that has already been deleted. Where is the problem? I’m using the…
-
0
votes1
answer278
viewsMongodb - Add documents that have a certain value within an array
Hello, thank you for your attention. If I have left any questions, please let me know. I found a problem that is driving me crazy. I have the following collection: { "_id":…
-
0
votes1
answer394
viewsExpressjs - Sequelize - Data type not recognized
I manually created an sql database and now I’m trying to configure my sequencing templates to match the columns in my sql tables, but I found a problem with my model related to an unrecognized field…
-
0
votes2
answers132
viewsError in a Function with callback
js and getting into callback I’m having a problem error: TypeError: callback is not a function at Timeout._onTimeout (C:\Users\SpiriT\Documents\estudo\callback\index.js:4:16) at ontimeout…
-
0
votes1
answer126
viewsPromises.all are on an infinite loop
I have the following code segment: generateEpisode(result,programId).then((arrayBlocks) =>{ const promises = [] arrayBlocks.map((file,index) =>{ promises.push(normalizeFile(file,index)) });…
-
0
votes0
answers31
viewsRing query using Mongoose
Good morning, I need to carry out a query by changing the data of the object in Mongoose but I have not obtained success in finding the internal methods that do this and both $Facet and subpipeline…
-
0
votes2
answers1659
viewsMongodb, mongod does not execute on cmd
I’m trying to run Mongodb 3.2 on a 32-bit Windows7 machine, but I’m having trouble running the command mongod in cmd, when I use the command it returns the following error:…
-
0
votes1
answer235
viewsError using Mysql Sequelize
Code to establish connection to the database: const Sequelize = require('sequelize') // Conexão com o banco de dados MySQL const sequelize = new Sequelize('postagens', 'root', 'mafikgod123@', {…
-
0
votes1
answer26
viewsInput capture of an angled form
I am trying to create an object containing all the inputs of a form so that if any are checked, others become disable. Is there any way document.forms['formParada'].elements['checkboxTipoParada'];…
-
0
votes1
answer990
viewsWhat is wrong in this Adonisjs relationship
I’m having the following mistake when I give Adonis Migration:run : { error: relation "polo" does not exist at Connection.parseE (C:\ckinfo\node_modules\pg\lib\connection.js:604:11) at…
-
0
votes1
answer244
viewsStoring input data in mysql + Javascript
I’m trying to store the input data below with javascript but the same is not storing: usuers.html file <input type="text" name="nome" id="nome"> <input type="text" name="email"…
-
0
votes1
answer672
viewsI can’t send file via post using "Xios"
Guys good day I’m with a project in Ode.js and I stuck in a situation,I already researched a lot and I can not find a solution so far. I am creating a Rest api that is consumed through Axios a GLPI…
node.jsasked 5 years ago Adailton90 11 -
0
votes1
answer140
viewsLink data in Mongodb
Model const AvaliacaoShema = new Schema({ responsavel: { type: String, required: true }, time: { type: Schema.Types.ObjectId, ref: 'Time', required: true }, pergunta: [{ type: Schema.Types.ObjectId,…
-
0
votes1
answer94
viewsHow popular are multiple <select> "with distinct results" in a single app.get() route?
Still beginner in Nodejs and working with Express, Handlebars and Mysql. In a form - which in the future will be a register, this has among other inputs, two <select> any, one must be filled…
-
0
votes1
answer503
viewsHow to delete a record with a foreign key using sequelize
I created a web application using sequelize, my model looked like this: const Product = db.sequelize.define('product', { idProduct: { type: db.Sequelize.STRING, primaryKey: true, autoIncrement:…
-
0
votes0
answers881
viewsTypeerror: app.use() requires a middleware Function
Index const express = require("express"); const bodyParser = require("body-parser"); const router = require("./config/routes"); const app = express(); app.use(bodyParser.json());…
-
0
votes1
answer523
viewsexport default class and import not working
I am trying to perform the default export of a class in Node.js, but when I try to compile the main.js file a type error is returned: Syntaxerror: Unexpected Identifier at new Script (vm.js:84:7)…
-
0
votes1
answer699
viewsProxy error npm install
I installed Nodejs and Angular, went to the prompty and tried to run npm install in my project folder, however, even after I set up the proxy with: npm config set proxy…
-
0
votes1
answer35
viewsQuery between multiple Inserts
I have an api that is every second (varying the time according to the response of the webservice) sending data to be inserted into the nodejs(v12.11.0) of several units that call the url…
-
0
votes0
answers754
viewsSequelize Timezone postgresql
I’m performing a sequel, but when I return the information that was recorded, returns with 3 hours above the postgres. json Insomnia: Given in postgres: I tried to change Timezone in sequelize, but…
-
0
votes2
answers81
viewsNodejs - Change the value of a vector in an if Else
I’m trying to make a function that can return the values if they’re being passed by the parameters or by the body of a request, the solution I thought was this: function getReqInfo(req){ let params…
-
0
votes0
answers80
viewsDifference between If with and without keys
I was following some courses of Nodejs, and I realized that in many of the cases is used a if more basic than traditional (I come from C#). My question is the following: Is there any difference…
-
0
votes2
answers81
viewsNodejs Async / Await / Promisse
I have a question, I need to make the code below, wait for the . map to be executed, and parseCategory() calls an API to get the articles. It turns out that the "final..." console output is executed…
-
0
votes0
answers35
viewsPerform two consecutive and dependent Mysql inserts with Node JS
Good Morning Everyone. I have a problem and I need your help. My case is as follows: I have a TASK table and a DIAS_TAREFA table that has a foreign key for id_task. Therefore, after storing the data…
-
0
votes0
answers61
viewsRemove all strings before keys via javascript
I have a css file and I would like to generate a JSON, for this, the first step I found would be to remove the entire selector before the brackets .meuSeletor { propriedade: valor; } for {…
-
0
votes1
answer490
viewsFailed to install Electron in windows 10
I’m trying to install Electron in windows 10 using these commands: - git clone https://github.com/electron/electron-quick-start - cd electron-quick-start - npm install && npm start I’m…
-
0
votes1
answer162
viewsHow to log in with firebase and consume data from a local Rest api made with Node?
I have a React-Native application that consumes the data of an api made with Node and Mongo. And a simple application, is a CRUD of a "user" entity. However I have route protection using JWT in the…
-
0
votes0
answers23
viewsHow to safely store sensitive data collections in a mobile app?
In order to illustrate my doubt more clearly, think that I want to produce an app based on the primary goal achieved by Keypass or 1Password, that is, store sensitive data securely. My goal is to…
node.jsasked 4 years, 11 months ago Fábio Jânio 3,407 -
0
votes1
answer132
viewsData synchronization, mysql and Promise
I’m a beginner in Node.js and I’m trying to understand why I can’t bring the expected result of my API. I have an application that sends an array of data to an API on Node to be saved to the…