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
-
1
votes1
answer202
viewsEvery time I start a server Mongoose makes an unnecessary connection to the database
Good evening, everyone! I’m starting in the area and as a first goal I decided to create a simple e-commerce, only every time I start my server, it runs a connection to the database unnecessarily, I…
-
1
votes1
answer550
viewsCreate a JSON and add elements dynamically
I wanted to know how to create a JSON and then add elements dynamically. The initial JSON needs to be like this: { id: Lime.Guid(), type: "application/vnd.lime.collection+json", to:…
-
1
votes1
answer1821
viewsThe data property does not exist in type 'Intrinsicattributes & Intrinsicclassattributes & Readonly & Readonly<{ Children?: Reactnode; }>'. ts(2322)
Português: The type '{ data: Undefined; }' cannot be assigned to the type 'Intrinsicattributes & Intrinsicclassattributes & Readonly & Readonly<{ Children?: Reactnode; }>'. A…
-
1
votes1
answer167
viewsAxios instance does not return in nodejs export
I’m trying to return the instance created through the module.exports, but when I try to use it it gives me that mistake: http(...). get is not a Function My http-common.js file var axios =…
-
1
votes1
answer76
viewsHow to capture class attribute with Cheerio?
I’m studying Web Scrapping with Cheerio and Request. I’m having a hard time trying to capture the class attribute on the Amazon site that contains a div list and is not returning anything. var…
-
1
votes0
answers52
viewsHow to change the state of a variable using Express and EJS?
I am trying to implement a Loader in my application as follows: 1 - seto a variável isLoading para true 2 - faço as requests 3 - seto a variável isLoading para false With this variable I can make an…
-
1
votes1
answer647
viewsHow to set up Gulp.task default Sass and watch
hello I’m having some problems configuring gulpfile.js to automate the conversion of Sass to css in the test project, below I explain the environment and errors presented Folder structure //layout |…
-
1
votes2
answers43
viewsDoubt when migrating Gulp code
Good evening, I would like to know how to update this code snippet from Gulp 3 to Gulp 4. Everything before worked perfectly, I was updating the lib for vulnerabilities and now appears the following…
-
1
votes0
answers138
viewsSELECT * FROM with Node and socket.io
Good morning guys, I’d like to know how I can make one select on the bench with Nodejs, using the socket.io. In the code below I show the commented line, where it is to be the select, but it does…
node.jsasked 5 years, 2 months ago Fabricio Carneiro 25 -
1
votes0
answers21
viewsHow to load modules concatenated with Gulp in Requirejs?
My project has several AMD modules being loaded into the browser by Requirejs. However, I am migrating from Javascript to Typescript and also want to use Gulp to transpose to Javascript and generate…
-
1
votes1
answer69
viewsNODE.JS MSSQL use SQL NEWID() function as a variable value
Good afternoon! It has an SQL function (NEWID()) that generates a single key with this format: '6F9619FF-8B86-D011-B42D-00C04FC964FF' However, when I try to populate a column with the NEWID() value…
-
1
votes0
answers103
viewsNodejs Hierarchical Menu
I’m trying to build a dynamic menu based on this table here: 1 CONFIGURACOES 0 2 ADMINISTRATIVO 0 3 USUARIOS 2 4 INSERIR_USUARIO 3 5 ALTERAR_USUARIO 3 6 EXCLUIR_USUARIO 3 7 MENUS_DE_ACESSO 2 8…
-
1
votes1
answer158
viewsGoogle Maps and Websocket Flutter
All right, come on... I’m developing an application using flutter (I’m new to the Dart language), so I need my application to update the markers of maps periodically along with Websocket, but when…
-
1
votes1
answer500
viewsCrud ID with javascript
import api from '../../services/api' export default function Area() { const [ area, setArea ] = useState([]) useEffect(() => { async function loadArea() { const response = await api.get('/area')…
-
1
votes0
answers30
viewsSubmit form with file
I have the following form: <form [formGroup]="notifForm"> <div class="box-body"> <app-input errorMessage="Preencha a Descrição" [showTip]="false"> <label…
-
1
votes1
answer343
viewsHow do I generate an excel file with the data obtained from a webcrawler?
I’m making a web Rawler that should extract the name and price of iphones that appear in search on the Amazon site and generate an xlsx file with this data. However, I am unable to generate the xlsx…
-
1
votes0
answers149
viewsTypeerror: app.config.dbConnection is not a Function
I’m getting the bug TypeError: app.config.dbConnection is not a function when refactoring a code with Consign so that the connection module with the database is executed only on the required pages.…
-
1
votes1
answer694
viewsCannot read Property 'query' of Undefined
The mistake Cannot read property 'query' of undefined is reported when trying to save data to the database. However, the Property query works for getNews. Ex: function NewsDAO(database){…
-
1
votes0
answers938
viewsIs it possible to run a Javascript file and have the output on the Node.js console inside the Visual Studio IDE 2019?
Is it possible in Visual Studio IDE 2019 to run a javascript file and get the output from the Node.js console that is inside Visual Studio? how Visual Studio Code has the Node extension called "Node…
-
1
votes1
answer61
viewsTesting that all asynchronous functions have been terminated
Greetings I’m developing a synchronizer between two databases (SQL Server and MySQL) with the ElectronJS and the Node.JS and everything is working fine, but I would like it to perform…
-
1
votes1
answer188
viewsDesktop app, using Electron and nodejs
Hello, I wonder how I can pass the value of a field that is in (index.html) to a function that is (data-user.js). I have an application in nodejs using Electron, the main calls index.html, which…
-
1
votes1
answer893
viewsJs Node / Routes / Controllers
I’m starting to study the nodejs and a question has arisen: Good I wanted to make an api to power the front - end web and mobile with this api in case I have these routes (only for study): const…
node.jsasked 5 years, 1 month ago Joao Spirit 101 -
1
votes1
answer162
viewsUse of "Return" in module.Exports
I am developing a project in Nodejs and at the moment, I am facing some problems when returning some value of a function within a module. Code: Archive for queries async function query(query){…
-
1
votes2
answers631
viewsHow to verify the occurrence of a given string and return part of it?
I have a small solution developed on the Node.js platform, at the moment I need to check if a given string exists, if it exists it will be necessary to capture the value INTEIRO contained in this.…
-
1
votes1
answer218
viewsError picking up input from a <form> with Mongoose/nodejs
Hello, I recently started learning Node.js and I’m using Mongoose to integrate with db 'mongodb', and in this application I’m trying to take data of 2 and insert this data into the database, I made…
-
1
votes1
answer290
viewsIf function return does not recognize true, only false
I have this code below, which was to if the function returns true, it runs if. But it only executes if if I change if to false, that is, by putting "if(!linkAlreadySent)" instead of…
-
1
votes1
answer166
viewsError finding directory . handlebars
I have the following folder and file structure in my Node project: And the following configuration of email templates: configureTemplates() { const viewPath = resolve(__dirname, '..', 'app',…
-
1
votes1
answer1551
viewsError handling in js Node
I’m doing an error treatment that if a wrong id is passed by url he returns a error 400, but when I take the test it returns a error 200 one more message "error": "Error", "message": "Cast to…
-
1
votes1
answer1057
viewsHow to recover user IP using Node
Hello, how can I make an application that "picks up" the user’s IP using Node? Currently my code is like this: const express = require('express'); const handlebars = require('express-handlebars');…
-
1
votes1
answer104
viewsNodejs / Reactjs: Manipulating Token
I’d like your help. I have an API with Nodejs that performs user authentication (POST method), generating a Token (jwt) and returning the same: module.exports = { async authenticate(req, res) {…
-
1
votes2
answers790
viewsHow can I use a handlebar variable inside a script
So I’m creating a nodejs project. I’m using handlebars as my template engine and sequelize as ORM. In my route file, I create a route and send the object "status" to my form page. (in this case, the…
-
1
votes0
answers128
viewsHow to return token in user registration in Adonis?
I am creating a user registration api and would like to return beyond the registered user, the jwt token. These are currently my duties: initializeCreate( {request} ){ const data =…
-
1
votes0
answers73
viewsWorkaround: error Calling Appregistry.runApplication in React-Native
Guys, I use the Linux Mint 19.2. While trying to run an React Native application, via terminal, using the React-Native run-android command, I came across the error Calling…
-
1
votes0
answers1567
viewsFormdata with Axios in Node.js
When I try to make a request using form-data with Node, the Springboot application that receives the request says it doesn’t have "Boundary". And when I put any value in "Boundary", the application…
-
1
votes0
answers17
viewsCloud Save app creation for premium users only
I work with React-On and have an interest in creating an application that saves in a cloud database for premium users only. The user would normally persist on the local device, but if I had a…
-
1
votes0
answers58
viewsHow can I redirect my user to another screen by passing a HEADER with Nodejs
I’m doing the authentication/authorization part of my application, and I need to pass through my screens always passing the TOKEN through the HEADER, but I can’t redirect my user passing the TOKEN…
-
1
votes1
answer383
viewsMongoose is updating wrong object in mongodb
I have a problem saving the data in mongodb. Context I have an express api that listens to requests to save the data to the mongodb an application sends. This data is related to APP page views,…
-
1
votes0
answers105
viewsAutomate express response function (res.send())
I have an express api and would like to develop a function to standardize the customer response. Code (running the function): response(200, "Evento adicionado com sucesso!", res) Scope of function:…
-
1
votes1
answer1924
viewsRequest is presenting Cross-Origin Request Blocked in Reactjs app
I am developing an application in React and previously created a restful API with Node and express, in my api I added the module Cors const cors = require('cors'); and added it at the boot of the…
-
1
votes1
answer2635
viewsI can’t load CSS and Javascript on my Node.js page
I am unable to load the css and js, when running the server I get the following message on the console: "Refused to apply style from '' because its MIME type ('text/html') is not a supported…
-
1
votes1
answer548
viewsError installing npm
I use Linux Mint 19, some time ago, I installed npm, nodejs, bootstrap, as well as Jquery, Popper.js, etc. However, I decided to delete the folder where I had installed such files, to start again.…
-
1
votes1
answer377
viewsSend jwt in header by GET
Hello I would like to know how I could send a jwt in my header to consume in my API, a route get to catch users ( need auth ) my api to catch users: app.route('/users') .all(app.auth.authenticate())…
-
1
votes0
answers66
viewsI can’t get a relationship going Lucido on Adonis
I have the following schema: Book: class BookSchema extends Schema { up () { this.create('books', (table) => { table.increments() table.string('description') table.timestamps() }) } Bookunit:…
-
1
votes1
answer83
viewsClass javascript
Hello I’m with this error when trying to model a class in javascript: Player.makePlayer(player,1) ^ TypeError: Player.makePlayer is not a function class player: class Player { constructor() {…
-
1
votes1
answer513
viewsNodejs/Adonis Application Deploy on Heroku: Receiving 503 Status: Unvailable Service
I’m trying to deploy an API-only application using Heroku, but I deploy it and when I try to get a route I get: Status: 503 Service Unvailable. Man Procfile: release: ENV_SILENT=true node ace…
-
1
votes1
answer116
viewsUploading files with Vue.js and Filepond
I am developing an application that uploads files using the 'Filepond' library, which is a file manager. When selecting the file that will be uploaded, the library returns the file blob, which is…
-
1
votes0
answers25
viewsCreate subquery in Mongoose
Which brings the following table ________________________________________ id | descricao | ip | id_parent | 1 | Teste | 14 | 0 | 2 | Outro | 15 | 1 | 3 | Meter | 16 | 1 | 4 | Tra | 17 | 2 | I have…
-
1
votes1
answer149
viewsNode js loop Time
I am performing these functions below in a for. The functionality is almost doing what I wish, but I wonder if it would be like after running const q = await clientOut.write(p[i]), wait at least 3…
-
1
votes1
answer90
viewsHow to decrease decimal places with EJS
I am creating an application with Node.js, using the view engine EJS, and have a calculation of preço * quantidade, but the result is something like 80.9999999. Does anyone know how I can round this…
-
1
votes2
answers46
viewsI’m not passing any data on the request but it seems that some information is coming
I have a method index that returns places (houses/apartments) registered on the site. It is possible to filter by location and key characteristics if the person wants. If you do not want, I return…