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
votes0
answers49
viewsHow do I get gitlab to access the ec2 instance?
i created a script to deploy at an instance of ec2. The idea is to enter the instance terminal, run a git pull and restart pm2. But when I try to access ec2 the following error appears:…
-
2
votes1
answer345
viewsNodejs - Async await with Mongoose
I am creating an API with nodejs and Mongoose, I am trying to create a user using async await, but I did not succeed, whenever I send the data they are not saved, I already checked the entire…
-
2
votes0
answers50
viewsSet url(path) when importing fontawesome with Sass
Hello! I’m working with Node+webpack+Sass. When I run the script wabpack, is made the compilation of Sass, the Bundle of the js files and the result is all placed in the directory build/. Until…
-
2
votes1
answer57
viewsDoes Settimeout run in parallel on Node.js?
I’m studying the concepts of asymchronism, I know that Node.js is single-threaded and that for some types of task he delegates the same to the libuv (which has 4 threads by default) and others for…
-
2
votes1
answer363
viewsTypeorm query with Inner Join is coming empty
I made two tables, Usuario 1 : N Produto I made an Inner Join with Typeorm, but an empty array was coming, so I took the query it was generating to analyze it better. When I played the query in…
-
2
votes1
answer155
viewsAxios: stop in GET does not work - React Native
I have a database in Mongo with customers and establishments. I want to recover the establishments filtered by category. My code is like this: const [datas, setDatas] = useState([]) //recupera os…
-
2
votes2
answers170
viewsI want to generate 4 random values from an array. How can I do it?
I’m looking to generate 4 random values from an array. I’ve tried using Math.Random, but it’s in an infinite loop... import React, { useState, useEffect } from "react"; import api from…
-
2
votes1
answer347
viewsHow to upload files with Multer to two different storages?
Good evening, I need to upload a file to a local folder (where it will be treated to compress the file) and to Storage S3. S3 configuration and local multer storage is programmed and both work…
-
2
votes1
answer90
viewsHow to delete all FK records by deleting their "owner" with Sequelize?
I’m making a database and it has some properties and it has users. A user can have several properties, so in the properties table I inserted the column user_id, to reference the user. But when I…
-
2
votes2
answers99
viewsProgram a test to check for libraries in the "package.json" type "@types/..." that are in the wrong place. Is it possible?
I’ve taken several times package.json libraries "@types/..." in "dependencies" instead of "devDependencies". It is that they were installed without adding the parameter -D during the yarn add.…
-
2
votes1
answer101
viewsHow to consume Event-stream with nodejs
I have a nodejs application that needs to consume an endpoint that returns a text/event-stream. The application that issues these events is done with java and packages a data within an object…
-
2
votes1
answer209
viewsWhen calling an asynchronous function, is it also necessary to note the calling function as "async"?
I have a question about asynchronous functions. I have the following function in my file models: const login = async (email, password) => { código qualquer aqui... }; And now I need to call this…
-
2
votes1
answer43
viewsProblem with running order of endpoints in Express with conflicting paths
I have this question about endpoints express bred. In this first section, the endpoint /anuncios/:search must search in the fields descricao and nome by the text reported. Therefore, a call…
-
2
votes1
answer97
viewsUpdate is not performed in the Database using Sequelize and Nodejs
I have the following route that is responsible for receiving the data coming from a form and doing an update of the data that is in my database router.post('/articles/update', (req, res) => { let…
-
2
votes3
answers171
viewsTrying to manipulate a JSON with JS
I’m trying to take a data from the json file and copy it to another JSON file using Javascript, but I never did that I have this JS code: let fs = require("fs") let gravador = []…
-
2
votes1
answer104
viewsError in Reload, ts-Node-dev and Prismaclient
Good afternoon my friends, all in peace? I’m having to migrate a small API to Prisma by removing Typeorm. Well, so far I have been able to install and run smoothly, MAS (normal, kkkk). I noticed…
-
2
votes1
answer47
viewsHow do I make the user repository use the extends property?
I’m trying to make a generic repository, I’m using Mongodb for that, I tried to import it and use it with the property extends other classes, but did not succeed. What I need is to make the class…
-
2
votes1
answer121
viewsHusky and commitlint do not work before the git commit command
The Husky and commitlint packages were installed to a Nodejs project with the intention of adding Hooks to the commands git commit to maintain the same style guide in commit. However the Hooks are…
-
2
votes1
answer177
viewsHow to make a #if with comparison of two variables using handlebars and nodejs
My problem is in creating #if with a comparison with two variables on the .handlebars. page In the edition page I retrieve the data and fill in the fields, however in my select, I need to compare…
-
2
votes2
answers215
viewsFs.writeFile() is overwriting a file
I am writing a script using Node.JS that checks how many points a customer has in their registration, and I need that every purchase above 150 real that he makes, the point increase by 1, when you…
-
2
votes1
answer62
viewsfindByIdAndUpdate() is creating document instead of updating
I am crud using Node, Express and Mongodb, but I have a problem with the update operation when using the findByIdAndUpdate() Mongoose it is not updating the document but creating a new.…
-
2
votes1
answer27
viewsMongodb not recognizing command when someone writes something in front
I have a bot and saved its commands in the Mongodb database, but when I write, for example, "! command and other things on a line" it does not answer, how could it ignore these other words? My code…
-
2
votes0
answers101
viewsTypeerror: Cannot read Property 'findOne' of Undefined (strapi)
I am creating an eCommerce using Strapi, but I have a problem in one of the routes that makes the POST. Summarizing this route she opens a payment session, and for that I step one request.body with…
-
2
votes1
answer35
viewsWhat is the best way to get values within multiple tags in multiple HTML files
I have several HTML pages, so: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html…
-
2
votes1
answer55
viewsInserting CSV into Postgresql with Nodejs
I want to insert a CSV into a postgresql table. CSV contains rows with multiple column numbers. Ex: 1,2,3 1,2,3,4,5 1,2,3,4,5,6 1,2,3,4 When performing the insertion, the following error occurs:…
-
2
votes1
answer95
viewsHow to insert JSON values in Postgresql using Nodejs?
I intend to perform an Insert in a table in Postgresql. The values that will be used in the query are from a JSON in which I have access through a GET. fetch(…
-
2
votes1
answer32
viewsWhat is the real difference between Fs.readFile() and Fs.createReadSream()?
The point is that I can use both functions to do the same thing. For example: const fs = require('fs') const path = require('path') const filePath = path.join(__dirname, '../arquivo.txt')…
-
2
votes1
answer211
viewsTypeerror: replaceAll is not a Function
I am developing a system in Electron that works well, but when running the tests in Jest I get the following error: console.error Error: Uncaught [TypeError: value.replaceAll is not a function] at…
-
2
votes2
answers172
viewsHow to scrape Qlikview tables using Nodejs?
This website of the Brazilian government presents salary data to judges of various courts and tribunals. I would like to download all tables, but the data relating to the tables are not in the html…
-
2
votes0
answers23
viewsHooks Sequelize
For purposes of understanding: Node.js with database postgres running with Sequelize v4; Some fields of my database need to be persisted in encrypted database, by business requirement. Using the…
-
1
votes1
answer224
viewsHow to use Phantomjs to access a JSON responsive API
How to use PhantomJS to access an API whose response is JSON and not HTML and process the result? I would like the example to use the Stackoverflow API itself in English, so that the script returns…
-
1
votes1
answer80
viewsUpload a nodjs and mongodb project into a VPS
I developed my project with Nodejs and Mongodb on Windows, now I intend to upload it in an Ubuntu VPS with these already installed software, I already have Putty installed on my machine and I got…
-
1
votes2
answers326
viewsDatabase to work with nodejs
I’m developing an entire application with Nodejs. The main reasons for using Nodejs are financial/performance. I have not yet worked with database using Nodejs, but I have some doubts, since the…
-
1
votes1
answer276
viewsGoing up Node.js project (with websocket) to Heroku
This is the project: http://googlecreativelab.github.io/coder-projects/projects/blinky_lights/ I followed all these steps: Heroku login ssh-keygen -t rsa heroku keys:add Procfile (web: tilestream…
-
1
votes1
answer765
viewsUpload multiple files with Node.js
I’m trying to upload multiple files with Node.js, but I can’t do the server part. I am using Expressjs as a framework, and if necessary I can use other packages to facilitate this task. For now, I’m…
node.js upload file-upload express multiple-file-uploadasked 10 years, 3 months ago André Leria 5,047 -
1
votes1
answer226
viewsHow to run Node.JS on Openshift and Locally
How to run Node.JS in Openshift (https://www.openshift.com/)? Url of openshift: http://nodejs2-agenciadreamup.rhcloud.com/ Github: https://github.com/AlanPS/StreamBrasil/ How to run Nodejs locally,…
-
1
votes1
answer114
viewsFacebook Graph returns a different id than what is saved using Passport-facebook
I have an application where the user logs in using the facebook account, saving the id, name and email. I am using https://github.com/jaredhanson/passport-facebook Excerpt: //Cria um usuario do…
-
1
votes1
answer3063
viewsHow to install Ode.js in shared hosting (Cpanel)?
DESCRIPTION: I have a shared hosting (Cpanel) and I want to install Node.js in this hosting so I can install the GHOST, great tool to manage articles without the need to base my entire project on a…
-
1
votes1
answer227
viewsCopy Nodejs project to another machine
I have Nodejs installed on 2 machines. I need to migrate the design from one machine to another. Just copy only the project folder or on the target machine I will have to do something? Installed…
node.jsasked 10 years ago Filipe Moraes 8,737 -
1
votes2
answers333
viewsQuery using Mongoose in Nodejs always returns null even within asynchronous method
I am trying to recover a document in my Database using Mongoose in Node.js but it always returns Null. My problem before was the asynchronous method, but now everything is running within it. And I’m…
-
1
votes1
answer228
viewsHow to set up Nginx for nodejs and php?
I’m here trying to set up a basic server at digitalocean, where I wanted when accessing meudominio.com it redirect to the program in nodejs+express running at port 3000 and accessing…
-
1
votes1
answer132
viewsMongodb and Redis on the same server
I am planning a system that uses Mongodb for reading data and Redis for session sharing between PHP and Nodejs. Is there any problem having Redis and Mongodb running on the same server, since both…
-
1
votes0
answers75
viewsProportional Y values
Hello, how do I leave the Y | values proportional without changing the values for better data visualization $(function() { $(document).ready(function() { Highcharts.setOptions({ global: { useUTC:…
-
1
votes1
answer486
viewsRedirect url to url:htaccess port
It’s using Node to run my application and I can’t configure htaccess to point to the port I set RewriteEngine on RewriteCond %{HTTP_HOST} ^dashponto.softmarketing.com.br$ [OR] RewriteCond…
-
1
votes1
answer396
viewsHow to edit page after rendered with Node.js?
I need every time a page with a path is rendered to be added a paragraph after the <body> and another paragraph before the </body>. I’m using Express.js and da to do this by picking up…
-
1
votes0
answers218
viewsSave data by websocket
I am developing a system using Angularjs and Websocket (PHP or Nodejs I am still defining), where the information of the forms I intend to save via socket, ie by sending an array with the…
-
1
votes1
answer4198
viewsHow to call a file in Node.js
I want to know what I call a.js file if anyone can explain step by step thank you. As far as I understand to call an external file I have to create a kind of package that proceeds?
-
1
votes3
answers749
viewsNode.js application always falls after an error
I have an application in Node.js that whenever any error occurs it falls, having to be restarted manually, always. How do I make the error report, but the application keeps running?
-
1
votes1
answer166
viewsOffline modules in Nodejs with npmbox
I know it is possible to manage Node modules while offline through npmbox. But how do I do that? Is it necessary to download the modules first? You need to install them in a different project…
node.jsasked 9 years, 8 months ago Inaldo Eleuterio 23 -
1
votes1
answer167
viewsError sharing HTTP Session with socket.io. io.sets "is not Valid".
I am applying the step by step book "Node.js, real-time applications" of Caio Ribeiro Pereira. All right until the part about sharing the HTTP express-Session to the socket.io. As far as I can see…