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
answer200
viewsproblem sending values from one route to another
I am making a login system with mysql I am unable to pass the route values to another i want to go from login router to users router the code is followed connection.query('SELECT * FROM users WHERE…
-
0
votes1
answer123
views -
0
votes3
answers96
viewsHow to get information in a text?
would like to search and extract a string that is between tags. Using Javascript only with Node. Example: Extract information inside any tag and save in some variable. I don’t know how to implement…
-
0
votes0
answers32
viewsImage upload problem in nodejs
I am performing a test to implement an image upload and created the following code in the back end in Node js. function uploadImagem (req, res) { var restauranteId = req.params.id; var file_name =…
-
0
votes1
answer99
viewsuser checking problem already exists in mysql nodejs
I’m having trouble getting it working or checking if the user already exists dynamically. Basically I want that when typing the user name says whether or not I am using the nodejs with express and…
-
0
votes1
answer88
viewsMocha + Chai do not access routes that require authentication
Talk, y'all, good afternoon. So I’m running some tests on my Node.js API using Mocha and chai, but I have a middleware that checks my user’s token so that it can access some HTTP requirements. The…
-
0
votes2
answers126
viewsCronjob on the Node, is there?
Hello, I am creating a system of tasks and notifications, it works like this: the user creates a task for the system to execute when it arrives at a given time, automatically, notifications are…
-
0
votes1
answer68
viewsRegistration is not being sent to the database
When I use 'Insert into noticias set ? ', to register in the bank, it is simply not registered Model: module.exports = function() { ... this.salvarNoticia = function(noticia, connection, callback) {…
-
0
votes0
answers177
viewsPOST in Reactjs with Object included, how to do?
I need to register for course instructors, in which each instructor will have a course. How do I? I’m doing it this way and it’s not going: PS.: the variable name and email receive a variable in…
-
0
votes1
answer386
viewsHow to make Tyscript read a JSON file that is on disk?
I have a code in Typescript (Nodejs-10.6.0) and need to create a variable that will recover the contents of a JSON file. I have tried to import the contents from the file in the following ways: 1.…
-
0
votes0
answers61
viewsProblem to send email with mailtrap using Docker(Mongodb)
I am studying the development of an API and I am having problems using mailtrap to test send email during user validation. The user is written to Mongo but it does not send the email and returns the…
-
0
votes1
answer890
viewsHow to implement Mongoose-paginate in Node Express?
I am trying to implement in my project Node Express paging in a menu list, and I found this documentation right below; MONGOOSE-PAGINATE According to the instructions I first installed lib with that…
-
0
votes0
answers242
viewsError: Cors when integrating nodejs and Angular 6
I have a problem that I need to treat, but I’m not getting any solution so far. I have an application in Nodejs that I developed in #Expressjs and I face some problems related to CORS Browser. In my…
-
0
votes1
answer1120
viewsHow to configure paging method in Node Express?
I have my paging method working perfectly with this URL: http://localhost:3000/menuspage See the code below; exports.list_all_dataProviders = async (req, res) => { const { filter, skip, limit,…
-
0
votes1
answer93
viewsFilter issues in lib API QUERY PARAMS
I am using this lib to apply filters api-query-params I need to perform the filter for this entity; 'use strict' const mongoose = require('mongoose'); const Schema = mongoose.Schema; const schema =…
-
0
votes1
answer44
viewsSet value within an object equal to the previous value
Is there any way to define the value of an object to be equal to the previous object? Example: var obj = {a: 1, b: obj.a}; I tried used b: this.a also but created an html Circle tag, I did not…
-
0
votes0
answers57
viewsTesting mysql API and nodejs integration
I have an API written in Nodejs (express) that uses the library mysql to pull data from a database hosted on AWS. API endpoints are basically SQL queries, almost without logic associated with data…
-
0
votes1
answer452
viewsError running npm install
I just installed linux Deepin on my pc, installed Node.js 10.0.6 along with npm 6.0.4. When running npm install , he of the error, so I executed the following command: npm audit fix --force and I…
-
0
votes1
answer217
viewsRead data from a url
I would like to get data from a url address Researching I found that one reply I implemented for my reality var http = require('http'); var options = { host: 'http://192.168.1.6', path:…
-
0
votes1
answer2377
viewsProblem picking query params in URL by Express
I’m creating a route GET which returns an item from a user array, but has no return when used req.query.id. When I use req.params.id right, but in that case I want to test for query string even.…
-
0
votes1
answer176
viewsHow to run http-server Node?
Guys I’m trying to install http-server npm install http-server -g however is giving this error, I already set the proxy, what can be? log: 0 info it worked if it ends with ok 1 verbose cli […
-
0
votes1
answer22
viewsError whenever I use Omit
I always have a mistake that covers the Omit. It doesn’t stop running the code, but it keeps dialing the vscode and it bothers me. constructor( { buyPrice, code, description, lovers, sellPrice, tags…
-
0
votes0
answers553
viewsCannot read Property 'Collection' of Undefined
Error: TypeError: Cannot read property 'collection' of undefined at Object.findAll (/Users/filipealves/node/crud/db.js:7:17) at /Users/filipealves/node/crud/routes/index.js:6:13 at Layer.handle [as…
-
0
votes2
answers74
viewshttp is not recognized in the Node Express project
My project is giving this error message; Why is my project not recognizing my http? I’m new, and I’m still learning to code in Express. This is my package.json; { "name": "registre", "version":…
-
0
votes1
answer78
viewsHow do I complete SQL table name with a variable value?
I want to create a new table for each client and I want to complete the account table with the client id I am creating in another table as in the example below: await db.run('create table if not…
-
0
votes1
answer55
viewsField multiplication in Sequelize
I have the following code thingy: const buys = await Buy.findAll({ where: { account_id: req.params.id, }, attributes: ['id', 'account_id', 'buy_value', 'quantity'], }); return res.json(buys); That…
-
0
votes0
answers41
viewsModule Node restarting on multiple requests
I am developing a personal project to perform performance tests on a list of websites and for this I am using the Lighthouse modules and Chrome-Launcher. In my application is being read a list of…
node.jsasked 6 years, 1 month ago Gabriel Schmidt Cordeiro 728 -
0
votes0
answers150
viewserror and server nodejs after 2 minutes
Good evening guys I have a basic program that until yesterday was good, today afternoon started the error in the execution of the "app nodemon" or only the "app Node" follows the error: throw er //…
-
0
votes0
answers170
viewsNode requests and module Exports
Good afternoon guys. Someone can answer a question for me. I have a Node.js application with an estr //index.js var express = require('express'); var app = express(); var valor = require('./valor');…
node.jsasked 6 years, 1 month ago Mauricio Schmitz 1 -
0
votes0
answers67
viewsreturn to view before executing the route.. nodejs
Good afternoon guys how do I return to view that fired the route without executes it ?? follows below the passage... app.post('/atendimentos/pesquisa', home.loggedIn, function (req, res) { var…
-
0
votes2
answers378
viewsJson - Take key from a value
I own a json: { "pendente": 0, "cancelada": 1, "remitida": 2 } I matter that way in my file.js: const enumJson = require("./dir/enum.json"); I wonder, how do I get the key from a value. For example,…
-
0
votes1
answer122
viewsFunction returning Undefined
Function returning Undefined, do not know what to do…
-
0
votes1
answer130
viewsJavascript IF return content
Good morning to all, I have a certain problem, if it was in pure Javascript I would have done using if and else no problems, as I did in another file and it worked! Basically the HTML file (with…
-
0
votes1
answer44
viewsProblems in Vue Js Syntax
Guys, today I installed Vue.js to start my first project and I came across the following problem. After the installation I created the project and when I opened the app.See the vs code was reading…
-
0
votes1
answer126
viewsERROR while accessing JSON keys with special character
Good evening, Folks! I am writing a Nodejs that accesses a URL that contains a JSON in that JSON the keys contains special character "-" that is causing error in my application which would be the…
-
0
votes1
answer404
viewsLoop without repeating Nodejs + mysql data?
I need to insert the DESCRIPTION field into a CATEGORY table; I have my data in JSON format (already on the server); My loop runs the sequence of steps: Checks whether the "category" field exists in…
-
0
votes1
answer527
viewsCallback with Redux-thunk
I’d like to know how to get a call back from dispath something like this, this with React: this.props.store.dispatch(dados, result => { console.log(result); }); On this line above the console.log…
-
0
votes1
answer33
viewsIs it possible to send JSX tags from Nodejs(backend) to Reactjs?
I need to send a data to the frontend, but I need it to be already with determinate tag around it, for example... given backend: Name: Gabriel I need you to get to the front this way:…
-
0
votes1
answer101
viewsFormat object with object array in properties - variable scope problem
Good morning, I have a problem returning from a webservice, I do a query to get Categories, and then another to get the items from that category. The goal is to assemble a return in the pattern: {…
-
0
votes2
answers47
viewsCheck if there is a value in Node JS
Hello I have a variable in Nodejs that sometimes comes with the following content: { '$instance': {} } and sometimes it comes like this: { '$instance': { numeropessoas: [ [Object] ] },…
-
0
votes0
answers94
viewsNode js without framework, check code
I’m trying to work with nodejs without framework to get a more detailed idea of how Node works. This code is the following: I make a request in the database and pass the result to renderFile to send…
node.jsasked 6 years ago João Victor Nóbrega 25 -
0
votes1
answer44
viewsreturn to view that fired the form in case of any error! Nojde+Express
Good morning guys, it looks simple but I haven’t been able to on my own and I haven’t found it on the net, I just wanted to return to view that fired Submit, I have a simple registration screen...…
-
0
votes0
answers44
viewsError to retrieve data from "raw" event
Well, I have a bot with this event: Bot.on('raw', async (event) => { if (event.t == "MESSAGE_REACTION_ADD") { const { d: data } = event; const user = Bot.users.fetch(data.user_id); const channel…
-
0
votes1
answer875
viewsNpm http-server not run after being installed
Good afternoon, on npm (Node package manager) installing http-server, would anyone have any idea why http-server is not being recognized? Editing ---> with the same live-server thing... some path…
-
0
votes2
answers68
viewsI can’t get the right timestamp time
I have an API I’m consuming and in it I have the field timestamp worthwhile 1604327859 and with that value I have the following time and date: This value above is correct, I am using the Moment.js…
-
0
votes0
answers301
viewsNode and Mongodb connection problems
A few days ago I’m having a problem with a code that I’m having trouble solving. What I’m trying to do at the moment is to register users in mongodb through Node. I am using the view ejs mechanism,…
-
0
votes2
answers126
viewsexecute a javascript file when the user accesses a Node route
I have the route / on my server.js: app.get("/", function(req, res){ res.sendFile("public/index.html", {root: __dirname}) }) And I need to run another javascript file that is in the same directory…
-
0
votes0
answers104
viewsMy HTTP(GET) request is not running on ngOnInit() - Angular 6
I have a CRUD at Angular 6 that connects to Node and mysql. When I access the homepage the getQuotes() function loads all the data I need. When I access the screen to update a record and perform…
-
0
votes0
answers48
viewserror when connecting the Knex to the oracle Database
I am trying to connect the database to the nodejs with the Knex, but when making a call on the connection I get the following error, Unhandledpromiserejectionwarning: Error: DPI-1047: Cannot locate…
-
0
votes1
answer54
viewsProblems with Node + express routers
I have a sequence of methods (get, post, put, delete), however the put method is wrong and I do not know how to solve. this is the code snippet: router.route('/') .get((req, res) =>…