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
votes2
answers525
viewsHow to fix CORS error in Node.JS? (Web Crawler)
Well, me and my group of TCC we’re making a website, where his function is fetch products on various websites specializing in Hardware and show which site has the lowest price. We are making the…
-
1
votes1
answer41
viewsHow to use a Serverless function from Cloudmqtt?
I’m trying to integrate Cloudmqtt Broker with an AWS Node.js serverless function but I can’t find any documentation on how to do it. The goal is when arriving a message in Broker it trigar a Lambda…
-
1
votes0
answers67
viewsMultiple connections in serial port
I am writing a software, in Node.JS with Electron, that connects to a non fiscal thermal printer, but I ran into the following problem: On the client, they use a third-party software that connects…
-
1
votes1
answer1367
viewsInstallation of dependencies on npm start but not finish
I’m taking a course and accompanying a book of Nodejs. In the book I am asked to install the *Express and Babel, already in the course ask to install dependencies of an application that they make…
-
1
votes0
answers81
viewsHow to use Mysql’s SELECT + WHERE dynamically?
I need to search the Mysql database, however I may have one or more filters (maximum 6) in the WHERE clause. Example: SELECT * FROM 'table_name' WHERE coluna_1 = 'valor_1' or SELECT * FROM…
-
1
votes0
answers137
viewsSending string via Node by serial port to Arduino
I have a local server that keeps listening to the serial terminal of the Arduino and from certain data, he is able to make a select in a Mysql database to know if an RFID tag is registered (and…
-
1
votes1
answer279
viewsNode ~ Failure in Segmentation
I upgraded my Nodejs to the current LTS version and now it only returns a Segmentation Failure error…
node.jsasked 5 years, 4 months ago Jefferson Rodrigues 68 -
1
votes2
answers652
viewsDocker with React, refresh the updates without having to upload the container again
I created an application in React and decided to run it with Docker locally, only for development At Dockerfile it was like this: FROM node:8 WORKDIR /usr/src/app COPY package*.json ./ RUN npm…
-
1
votes0
answers45
viewsError using Redis in Node.js
Ola, I am trying to use REDIS in a Node application to control sections, but when using I get the error: Error: req.flash() requires sessions at Error (native) at IncomingMessage._flash [as…
-
1
votes1
answer144
viewsEquivalent to sendFile in restify
I would like to show a page when calling a route on Node using restify No express use like this: app.get('/', (req, res)=>{ res.sendFile(__dirname+'/index.html') }) What it would be like in…
-
1
votes1
answer14191
viewsChange color of text Discord [BOT]
I am trying to change the color of the text after cleaning in Discord chat. Example: !cclear (CHAT SUCCESSFULLY CLEANNED! ) <-- Appears in green color. My code so far: const Discord =…
node.jsasked 6 years, 10 months ago Pedro Augusto 13 -
1
votes2
answers130
viewsNode.js I cannot access a class property in class method
Fala galera, this starting to study Node.js, I’m doing an exercise here I’m encountering the following problem: In this case, I am not being able to access this.Ojects property, which was started in…
-
1
votes2
answers2024
viewsReturn of Request (Node.js)
I’m trying to consume an API with request, but I’d like to know how to assign the return to a variable. Here’s my code: var response function getWeather() { request(url, function (error, response,…
-
1
votes0
answers104
viewsComplex dialogues with Watson
I started to develop a chatbot using the watson, found surprising and simple to deploy. However I was left with some doubts of how to do and if it is possible (I saw in some chatbot). An example is,…
-
1
votes1
answer498
viewsHow to make condition in two different tables with sequelize?
How can I make this select in sequelize? select prestadores.status, financeiros.status as prestador_status from prestadores left join financeiros on prestadores.financeiro_id =…
-
1
votes1
answer86
viewsFunction loading problem Node socket.io
I have the following code: module.exports = function(app) { app.get('/', function(req, res) { res.render('chat/index'); var io = app.get('io'); io.on("connection", function(socket) {…
-
1
votes1
answer337
viewsWhat does this character mean in package.json dependencies?
What does this character mean in the version of the package json dependencies ? What is the utility ? What will change in my project with this ? { "name": "", "description": "", "version": "1.2.3",…
node.jsasked 5 years, 2 months ago Marcelo Batista 1,617 -
1
votes1
answer487
viewsForm with Node/EJS does not work!
Good morning guys, I’m making a form, using Node and the EJS view engine, however I’m having trouble getting data from the forms in the controller. The return of req.body is always Undefined. app.js…
-
1
votes1
answer1580
viewsEJS include dynamic
Using Express 4 and template engine EJS, I came across the following: Let’s say I have the following structure: meu_projeto/ +-- server.js +-- views/ ¦ +-- layout.js ¦ +-- admin/ ¦ ¦ +-- index.js ¦…
-
1
votes1
answer39
viewsSearch Object Array value
I have the following code: jsonOptions = [{"description": "Carro 1", "product": "4"}, {"description": "Carro 2", "product": "5"}, {"description": "Carro 3", "product": "6"}, {"description": "Carro…
-
1
votes0
answers94
viewsI need to automatically insert the value of a cell in my last input text "Txtgesamt" after the input text "Schriftlich" keyup event
Take the cell value of a Javascript table [Help] I need to insert the node value automatically into the last input text "Gesamt" after entering any value from the first vertical column, within the…
-
1
votes0
answers246
viewsError with Unexpected token?
I have a project on my machine that uses Node.js. It runs smoothly, but when I went to pass it to my server on C9.io (Linux) it is giving this error: user:~/workspace/guidebot (master) $ node…
-
1
votes2
answers1739
viewsUpload multiple images with Multer
I’m having a problem uploading multiple images with Multer. I saw that it has attributes like ANY, SINGLE and ARRAY. I can use SINGLE to send a single image, however I need to use several images,…
-
1
votes1
answer349
viewsHow to use helpers in Node.js to load settings?
In the Laravel Framework we have the configuration files centralized in the directory /config, these are simple files php returning a array key and value. To access these settings anywhere in the…
node.jsasked 5 years, 1 month ago Fábio Jânio 3,407 -
1
votes1
answer340
viewsI am trying to consume an api in js via get by Xios
I’m trying to consume an API on js via get by axios, API containing a parameter apikey, how the code should look? as I’m trying to do: axios.get('url', {params{apikey:'chave_api_key'}})…
-
1
votes1
answer305
viewsError while running dockerfile
I own one dockerfile which runs an application in Node.js FROM node RUN npm install mongoose RUN useradd --user-group --create-home --shell /bin/false app &&\ npm install --global [email protected]…
-
1
votes1
answer404
viewsError creating a table with sequelize "Typeerror: Cannot read Property 'sequelize' of Undefined"
I have the following error when trying to create a table: const Usuario = app.db.sequelize.define('user', { Typeerror: Cannot read Property 'sequelize' of Undefined My folder structure: My…
-
1
votes1
answer64
viewsThe updateOne function is not working, returns me OK, but does not change anything
I am using Mongodb to do data persistence in my application, with Nodejs. I make the call like this: module.exports = function (app) { var dbConfig = app.config.db; return { changeAccountStatus:…
-
1
votes2
answers462
viewsUndefined when accessing class attributes in Nodejs
Good afternoon, you guys, was developing an api with Node and Mongo using express and Mongoose and tried to implement the Pattern Repository, but when accessing the attributes of a class returns a…
-
1
votes1
answer108
viewsHow do I save a sequelize value to a variable in Node.js?
I use the following code var app = website.findOne({ where: { idwebsite: req.params.id } }) res.send(app); But the result on the screen is that {"isFulfilled":false,"isRejected":false} How do I save…
-
1
votes1
answer126
viewsStop execution of an asynchronous function
Hello, I’m a little new in the Javascript universe and its asynchronous. I have the following asynchronous function below. When entering the condition "!= null", I wish it to be terminated and the…
-
1
votes1
answer107
viewsProblem to install nodemon
I’m learning Node.JS and there’s a part I need to install nodemon. I use the command: npm install [email protected] -g And when checking the version of nodemon using: nodemon -v This error comes to me:…
-
1
votes1
answer45
viewsAsync request problem with variables
The problem is with variables why the function async is running after the variable assignment. what can I do for the function to run and wait for it to finish to take the variable value? var request…
-
1
votes1
answer1077
viewsNodejs does not respect the OS daylight saving schedule
I set my Timezone in the nodejs for America/Sao_paulo. But it does not respect the tables of the operating system. I use Ubuntu 18.04 LTS + Nodejs V10. The method getTimezoneOffset of Date me…
-
1
votes2
answers236
viewsPromises in Nodejs
I’m learning Node and picking up some of the asynchronous programming. To learn, I took the following example console.log("1"); setTimeout(function(){console.log("2");},3000); console.log("3");…
-
1
votes0
answers41
viewsAjax request error on Node
I have a view that contains a login form. The request is sent via ajax, but the data is not being captured and req.body in the back end is empty. Even if I create a string and switch to Node,…
-
1
votes1
answer893
viewsNodejs function, functioning
app.get('/', function(req, res){ res.send('Ola Mundo'); }); In the case of this simple code just to illustrate we have a function in nodejs with 2 parameters the request and the answer, I was…
-
1
votes1
answer61
viewsQuestion about ES6 import/export
Why does the code below not work? I am using the import/export in the standard ES6 in a Node.js environment with sucrase. Filing cabinet config.js: const token = 'example'; export default { token };…
-
1
votes0
answers664
viewsNode Js - Node-Soap
I have a Soap client with the following nodejs code: var soap = require('soap'); var url = 'bin/NfeStatusServico2.wsdl'; soap.createClient(url, function(err, client) { client.setSecurity(new…
-
1
votes1
answer472
viewsEnvironment variables will remain
I’m following this tutorial, on Linux, but every time I restart I have to set all the variables again What I have to do to make the settings remain and globally? I’m using Linux Mint Cinamon…
-
1
votes2
answers9406
viewserror in using packages installed via npm with -g
installed npm install typescript -g and npm install @angular/cli -g and I don’t have access to tsc and ng. 'ng' não é reconhecido como um comando interno ou externo, um programa operável ou um…
-
1
votes0
answers63
viewsAn OPTIONS is generated when a POST is made
I have an API and I’m trying to connect with an online store but every time I try to perform a POST is returned an OPTIONS. I decided to use JWT to authenticate orders and avoid OPTIONS but without…
-
1
votes1
answer62
viewsWhy is the POST not working on my Mongodb?
Whenever I execute the post command the Inuit returns me an empty User. router.post('/register', async (req,res) => { const { email } = req.body; try { if (await User.findOne({ email })) return…
-
1
votes1
answer318
viewsInsert data into answer server Node.js
Following people, I ran the example of hello world in Node.js provided in express.js, access it normal on my localhost:7000. It is possible for me to manipulate the hello World response, such as…
-
1
votes1
answer55
viewsHow to use multiple languages
I don’t have much experience with Node.js, and I needed to generate several signed links, I have this block of code that works well. bucket.file("test_users/xxxxx/avatar/thumbnail.jpeg")…
-
1
votes0
answers38
viewsHow to replace html tags and save to a new file
I’m trying to check a file .html, remove some tags and create a new file with the changes made. In the method that I am using at the moment (js, Gulp) I end up doing several Restplaces in chain, I…
-
1
votes2
answers108
viewsAsync Await / Promise / API Google JS Node Translator
I started using the Google Translator API (Google Cloud Translate API) today and am unable to apply the async/await in function translate. Follows the code: const api =…
-
1
votes1
answer250
viewsHow to get a return from a foreground nodejs
I can’t figure out how to get back a Password in Javascript. In the example below, how to get the return of const info? const GoogleSpreadSheet = require('google-spreadsheet'); const credentials =…
-
1
votes1
answer706
viewsThe `useMongoClient` option is no longer necessary in Mongoose 5.x, Please remove it
I tried to connect to the bank using these settings; 'use strict' var mongoose = require('mongoose'); mongoose.Promise = global.Promise; mongoose.connect('mongodb://127.0.0.1:27017/ep', {…
-
1
votes1
answer258
viewsRestful API with Nodejs and Mysql with Multiple Columns (I want to return json levels)
all right. Someone can help me with a matter of Angular, or the API with Node.js? I consult Mysql in an api with Node.js with Inner Join in 2 tables, but how to expect mysql returns me everything in…