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
answer1654
viewsWhat is the function of the populate method in Mongoose?
I am doubtful to understand the functionality of the populate method in Mongoose
-
0
votes1
answer133
viewsReference in the mongodb
Well, guys, I know there’s no such thing as a relationship, but I need to know how to do something related. I have two collections a call, Extinguisher and the other Historical, I want an extinct…
-
0
votes0
answers130
viewsThe requested Resource does not support http method
My code: var data = JSON.stringify(orderNo) options.path = "/1/sales?merchantOrderId=" + orderNo options.method = 'GET'; console.log(options) var req = https.request(options, function (res) {…
-
0
votes1
answer429
viewsUpload photo with Javascript
I need to take a photo and pressing the button this photo is sent to my server so I save in my database on base 64, I just can’t grab the photo and convert to Buffer. My code: (function() { 'use…
-
0
votes1
answer360
viewsRead Filereader generated string in result function
Next I’m able to generate a string in base 64 but I can’t send it to my server, follow the code: $scope.cadastraFoto = function(){ var input = document.getElementById('fotoPerfil').files[0] var…
-
0
votes1
answer698
viewsHow to improve select performance
I have to use Firebird, but I do not get along very well with database, I selected the following way: select first 5 skip ((1 - 1) * 10) distinct PRO.CODIGO, PRO.NIVEL_INTERESSE, PRO.DATA_RETORNO,…
-
0
votes1
answer283
viewsCss does not load
I am running several servers using Nginx + nodejs, but css does not load from the following message: Refused to apply style from 'https://konic.com.br/css/style.css' because its MIME type…
-
0
votes1
answer341
viewsHow to pull data from BD to Table ? (REACTJS + NODEJS + API)
I want to create a table (this table is already created in my frontend - only html and bootstrap) and that it contains information from my database, that is, from the people registered in my…
-
0
votes1
answer93
viewsHello, I would like to know if it is reliable to use express-Session in production environment
I am developing in Ode and need package for login authentication...
-
0
votes1
answer294
viewsTake folder and file path (at the same time) with Electron
Good morning guys. I wonder if you have how to get the path of files and folders (at the same time) using Electron. I am using 'dialog.showOpenDialog()', but it returns either just folders or only…
-
0
votes0
answers45
viewsHow to remove the form name from the url at angular 7?
When I direct to a component at the angle, its name is available at the page address for example http://localhost/#/form-login Would there be some way that the component name would be hidden?…
-
0
votes1
answer119
viewsScalability with Pm2 or Docker?
Good afternoon, I have a question about the differences.. I have an architecture Back Nodejs, Redis Frontend Vuejs What’s the difference between putting to climb with Docker swarm and putting PM2..…
-
0
votes1
answer285
viewsHow to use Datatable Plugin (Jquery) with Node.js
I am working with Node and express and need to fill a table with information that comes from an SQL Database. I run my get code from the page that way: app.get('/Home.ejs', (req, resp) => {…
-
0
votes1
answer372
viewsNumber of consultations held Nodejs
I would like to know the best way to get the number of requests made to a nodejs server since the last Restart. For example: Admin: Node index.js User: 127.0.0.1:3000/all User2: 127.0.0.1:3000/all…
-
0
votes1
answer132
viewsNodejs Removal of @types folder
I tried to remove the node_modules folder because I updated the nodejs and had to reinstall the modules. However, I am not allowed to remove the @types folder, not even with the administrator and I…
-
0
votes0
answers484
viewsGenerate file with nodejs
I have the following problem, I have an xml to json converter in javascript and this converter saves the converted object in a variable. I need to adapt this code to make it possible to write the…
-
0
votes1
answer57
viewshow to index an object numerically in Node.js?
I’m getting a . csv like this: animal, branco animal, preto inseto, branco inseto, preto animal, cinza I want to be able to use that mass of data this way: // obj = { animal : [branco, preto, cinza]…
-
0
votes1
answer33
viewsNpm remove test folders for production
npm Prune --Production removes the devDependencies packages. Is there any way that it also deletes project folders that I don’t want in production, like my "spec" test folder?…
-
0
votes2
answers830
viewsUnhandledpromiserejectionwarning: Sequelizedatabaseerror: Table 'salao. Users' doesn’t exist
Good morning, I’m facing the following problem Executing (default): INSERT INTO `Users` (`id`,`name`,`email`,`avatar`,`password_hash`,`provider`,`createdAt`,`updatedAt`) VALUES…
-
0
votes2
answers477
viewsNodemon and Nodejs
I am learning nodejs and would like to know how to add nodemon so that every time I save the project the same update my web page. I installed nodemon globally and put it in the package.json call {…
-
0
votes1
answer742
viewsgenerates error Can’t set headers after they are sent,is running 2 times
He’s running the contents of the validator 2 times, I’m new to Node.js and I don’t know what’s going on. When Validator returns an error to API for, when I have no return of an error the api works…
-
0
votes0
answers56
viewsPersist session even after server crash and up again in Nodejs
How do I persist the user login session even when the application "crasha" and comes back again. Currently when the server gives some unexpected error I go there fix the error and saved, then the…
-
0
votes0
answers44
viewsProblem using npm install on Ubuntu for Windows
When trying to install a dependency by npm install express I have the following error: By Powershell is running without errors, but as I prefer to use the linux terminal and want to keep windows on…
-
0
votes1
answer102
viewsError using Fs.createReadStream('file') to save a file to a formData() in Node
Hello, I try to save a file inside a formData() in nodejs, but when I check, Fs.createReadStream('file') says that 0 bytes were read. Could someone explain to me why this is happening? And if…
-
0
votes1
answer320
viewsError while executing POST method
I am facing a problem regarding the POST method, when triggering this method it normally inserts in the database, but the application (Node index.js) is finished, at the command prompt I get this…
-
0
votes1
answer237
viewsHow to handle errors in sequelize create
Hello, I would like to know how I can treat possible errors when performing a create with sequelize for example considering the following insertion Livros.create({ BK_TITLE: data.title, BK_GENRE:…
-
0
votes1
answer132
viewsError: Most Middleware in app nodejs
Running application nodejs. got this error: I ran my application with the command Node app.js Versions: Date of publication: 8.9.2 npm: 5.5.1 express: 4.15.5 Code app.js: /** * Module dependencies.…
-
0
votes0
answers551
viewsInsertion error: this. _Connection is not a Function
I am trying to make an insertion in the database using nodejs and mongodb, but I get the following error: TypeError: this._connection.open is not a function at UsuariosDAO.inserirUsuario…
-
0
votes0
answers55
viewsCheck if the mouse or keyboard has been triggered
I’m starting at the Electron, with that I need some help. How do I detect if the keyboard or mouse has been triggered? If one of the two has not been touched in less than 1 minute run a command.…
-
0
votes0
answers119
viewsSending data to a UDP client
I would like to know if there is any way I can send data to a udp client in nodejs through a browser. I have a form with any 2 fields, I need to take this data placed in the form and send it to the…
-
0
votes0
answers277
viewsRead static file with vuejs stand-alone
I have an application created with the default VUE-CLI configuration, and I need to read a json file from the public folder. After compiling the application with npm run build, the user should be…
-
0
votes1
answer118
viewsMongo indexes
I am starting the studies with the indexes. I have a base in Mongodb where the documents have about 10 fields. Searches can be done using all these variables. I created an index with all fields, and…
-
0
votes1
answer336
viewsHbs file does not redenrize
I’m making an application with backend Node.js and Handlebars. I’m having trouble rendering the file Hbs layout., I’ve run some tests on the archives server.js and main.js and the routes are ok.…
-
0
votes1
answer197
viewsError executing React-Native init command
I’m trying to create a project React Native in the MacOs for Terminal. I type the following commands in Terminal: > cd Desktop > mkdir curso-react > cd curso-react/ > react-native init…
-
0
votes1
answer516
viewspm2 is not recognised
After giving the command npm i -g pm2 When close and open cmd and type pm2 to test He says that: 'pm2' is not recognised as an internal or external command, a operable program or a batch file How to…
node.jsasked 5 years, 2 months ago adventistaam 3,354 -
0
votes1
answer1194
viewsReturn query result with Node
When I make a select in my bank MYSQL, I get the answer and I can display it to the user, but the problem is that this is not enough,just take the result and display it, I need for example to check…
-
0
votes1
answer135
viewsMethod of depreciated Mongoosis
I’m trying to make a connection with mblab but the connection method is deprecated. Version of the method is 4.9.7. What I need is 4.13.7. Structure: server.js const express = require('express');…
-
0
votes2
answers98
viewsCreate a controller to make a GET type request
I am creating a simple API with Ode that I do a news post, in this I am using express to create my routes of my application, I have already managed to create a controller that posts my news, but I…
-
0
votes1
answer265
viewsSend Object Array to Bulkcreate
I’m using Node JS (backend) with sequelize 4.4.2 and I need to send an array of objects from my front (React JS) but I can’t generate in the format that is expected, only to comment when I did a…
-
0
votes0
answers303
viewsProblem to save image to Node and React
I am trying to upload images to my server using Node and React, however, when trying to upload, it generates this message: Not allowed to load local Resource:…
-
0
votes2
answers422
viewsError installing nodemon globally
I have the following problem executing this command: npm install -g [email protected] --save-dev --save-exact Could someone help me?…
-
0
votes1
answer41
viewsDoubt in the recovery of the value of callback in Nodejs
I’m starting in Node.js running Function and would like to know how to return a db field and move to a variable, I usually use a callback, for example: Conect.query('select nome from pessoa where…
-
0
votes0
answers431
viewsTypeerror: Cannot read Property 'message' of Undefined
I am trying to create a code for on a particular channel when a message is identified, two Emojis are immediately added to that message, but in the messages on that specific channel. I’ve tried…
node.jsasked 5 years, 2 months ago user11837106 1 -
0
votes2
answers524
viewsMy localhost connection is taking too long
I created a Nodejs server with express but when I try to access http://localhost:3000 the page never loads, is loading only. const http = require('http') const express = require('express')…
-
0
votes2
answers289
viewsIonic - Transform image from Base64 to JPG
I’m making an app and I need to send an image to an api. But I only have the image in Base64 and I need it in jpg. Does anyone have any idea how I do it? public sendOnePhoto(photo: any) { const body…
-
0
votes1
answer804
viewsView nodejs data in front-end using express without using front-end framework
I wonder if there is any way to pass data manipulated in the back-end in nodejs to an html file without using front-end framemework. In my researches I found examples using jquery.
-
0
votes1
answer1379
views'Can’t set headers after they are sent. ' Express.js
I’m trying to send the variable 'name' to the client-side, but it’s only working when I run a respons.end() when I use two, returns this error: > 'Can't set headers after they are sent.' Server…
-
0
votes1
answer529
viewsOrganize Json file
I wanted a way to organize this Json file: { "ajuda": { "name":"Ajuda", "category": "Sistema", "desc":"Mostra todos os comandos disponiveis.", "usage":"ajuda [grupo ou comando]" }, "ping": {…
-
0
votes1
answer53
viewshow to pass the BRAND variable that receives an Array per Javascript URL to another page? what am I doing wrong?
function escolheControle(c) { controle = c; marca =todasAsmarcas[controle]; window.location="marcaWebkit.htm"; console.log(controle+' controle-----'); console.log(todasAsmarcas+'…
-
0
votes1
answer137
viewsViews not loading express/Node.js
I created a shirt folder inside the Views folder, and when directing the ejs file to be opened 'Marvel.ejs' it cannot find. Only finds if I put Marvel.ejs inside the Views folder and in no…