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
answer39
viewsVariables in JS Node
wanted to understand more the concept of variables in NODE. I tried to make a simple code to read a json from the internet. I created a variable to receive the name of the title, but after set, it…
-
-1
votes1
answer77
viewsHow to integrate Chart.js into an Electron application?
Hello, my dear friends! I am creating an Electron application in which I must generate graphics. Everything ofline! I am facing the following problem: My chart does not appear on my page! As shown…
-
-1
votes1
answer46
viewsI cannot add an item to an array
I am unable to use the ADDITIONAL function well I’m trying to make a cap that person can add the additional in the items however I’m not getting. I am new in the area of programming and I am…
-
-1
votes1
answer76
viewserror giving npm start at command prompt
i am starting now with js , and decided to make a bot for Discord servers, as I use the platform a lot. I started watching tutorials, and I made my first bot hosting on Repl.it, as I didn’t really…
-
-1
votes1
answer45
viewsAccess variable in another function, javascript
Hello, I’m developing a Discord Bot and I’m trying to make a command that needs to access a variable created in another function. if(msg.content.startsWith('z!setarcanaldenunciasrecebidas')){…
-
-1
votes1
answer31
viewsStrategy for big queries
I’m working on an application that features a map and needs to render hundreds of thousands of markers. The data for rendering is in the database and the query is costly. There is also the challenge…
-
-1
votes1
answer28
viewsPassport js error in Node
I am trying to log in my application with Passport but am encountering the following error: Referenceerror: Cannot access 'Passport' before initialization. At object. (C: Users Claudio Desktop new…
-
-1
votes1
answer2220
viewsCannot use import statement Outside a module - Typescript and Babel
I have the following setup: Package.json: "scripts": { "start": "node dist/server", "build": "babel src --extensions \".js,.ts\" --out-dir dist --copy-files --no-copy-ignored", "dev:server":…
-
-1
votes1
answer49
viewsfunction only returns predises
I’m studying on JS with Node and Express. I am developing an application that will consult emergency relief data through the GOV API. I have a function that returns the JSON data of a given CPF, it…
-
-1
votes1
answer26
viewsCreation of Global Vue component
Good afternoon.. I’m having the following error when trying to create a global component with VUEJS.. main.js import Vue from 'vue' import App from './App.vue' import vuetify from…
-
-1
votes1
answer43
viewsReuse mysql connection function where
Hello! Analyzing my source code I realized that within the project there is a part that repeats many times. I would like to reuse repetitive code in my mysql project const pool =…
-
-1
votes1
answer179
viewsDesignate Positions through reaction with Discord.Js
I’m trying to apply positions to those who reacted emote in 1 message, and it’s all working out, until the "if" part from within (when I try to separate the Emotes). With this he does not apply the…
node.jsasked 3 years, 5 months ago Lucas Lanfredi 7 -
-1
votes2
answers28
viewsImport JSON Database to Firestore
I have 2 databases in json where one is of indications, and the other are the comments of these statements. Follow the model of each database (with a single data): indication: { "id_indicacao": 52,…
-
-1
votes1
answer27
viewsFailed to load images in npm package development
I was developing an npm package and came across the following error. My current project structure is as follows:. inside my Assets folder has some images that I am needing to use for the development…
-
-1
votes1
answer78
viewsRun script compiled using typescript + Babel + typeorm
While trying to execute node .\dist\index.js compiled using Babel have the following error: In dev runs without errors, all tests also pass, consuming the API also everything normal, but when I…
-
-1
votes1
answer56
viewsHow to take specific values and sets in JSON
I have the following JSON { "navigator.zoom.in": "Zoom +", "navigator.zoom.out": "Zoom -", "badge_name_BR263": "GAMES 6!", "badge_name_BR264": "4Anos", "badge_name_X2046": "Cabana Aconchegante",…
-
-1
votes1
answer34
viewsHow to make React return specific components depending on the state?
I would like to know how to make React return the component depending on the state father. function One(){ return <div>1</div> } function Two(){ return <div>2</div> }…
-
-1
votes1
answer58
viewsTreatment of negative test cases with JEST
I have a Code Jest who should test a business rule that says: No client must have an invalid CPF it(" should not be able to create a new user whith a wrong CPF",async()=>{ const repositoryFake =…
-
-1
votes1
answer43
viewsconsole.log() is not printed when using (Ctrl + alt + n) in Ubuntu, with Code Runner installed
I started the study of Nodejs using Windows and over time I made the switch to Ubuntu operating system. I installed the Node on the machine, Vscode, and the Code Runner extension, all the same as…
-
-1
votes1
answer61
viewsProblems creating schema by Knex js
I am trying to create a relationship scheme between tables in Node express, and that apparently is right, even so is generating this error message. knex migrate:Latest migration file…
-
-1
votes1
answer51
viewsShow one button and hide another
Good morning, I’m trying to create several buttons that show other buttons. I’m trying to make that by clicking on a button show the content and clicking on another button the contents of the…
-
-1
votes1
answer58
viewsError: Please install tedious package Manually
I am trying to do a project in Node.js / Electron and need to get information from an SQL Server database. When I run the line below, the error appears: const db = new Sequelize('banco', 'sa',…
-
-1
votes1
answer16
viewsRunning Ionic build Ios on macOS with Node 7 I get a message 'stdout maxBuffer exceeded'. How to resolve?
Suddenly I started having this problem when I try to build my app with ionic build ios . I don’t understand what might have happened because it was running normal one day, but the next day it…
-
-1
votes1
answer78
viewsMongoerror: Authentication failed. Mongoose
I am running an application Node and mongodb Docker on my machine, but when I try to connect to the bank using moogose returns: MongoError: Authentication failed. at MessageStream.messageHandler…
-
-1
votes1
answer29
viewsRescuing data from request.headers in Node.js
hello personal I am new here, I am trying to rescue data from a post in nodejs by the request.headers through a middleware I created, but the function in the route file that is separated from the…
-
-1
votes1
answer26
viewsproblems with routes in JS + handlebars (Referenceerror: home is not defined)
I’m learning Ode.js, but I’m getting too caught up in establishing the routes correctly. The structure of my folder is currently like this The code of the file server.js is thus found: const express…
-
-1
votes1
answer40
viewsWhy does Mongodb (nodejs + Mongoose) not update object property of a document?
I have a document (Mongodb data) from user who has a field tags that stores the tags already used by the user. It is an object array in the format {text: 'tag1', count: 0}. The problem is when…
-
-1
votes1
answer14
viewsError ondelete Scade sequelize
I am in error when I will do the cascade deletion , using postgres sequelize in version 6. original: error: update or delete on table "Users" violates Foreign key Constraint "Tarefas_userid_fkey" on…
-
-1
votes1
answer24
viewsI can’t solve ERR_HTTP_HEADERS_SENT
My program points ERR_HTTP_HEADERS_SENT which by what I understand, occurs when a response has already been sent by the server. I’m trying to create a controller method of a route that changes some…
-
-1
votes1
answer28
viewsHow do I translate something in real time with "@iamtraction/google-Translate"?
const discord = require("discord.js"); const imdb = require("imdb-api"); module.exports = { name: "imdb", description: "Obtenha informações sobre séries e filmes", category: "utilidade", usage:…
-
-1
votes1
answer33
viewsExpress sends the answer before you have all the information you need
I am trying to make a tool just for my personal use, it is a WHOIS/ DNS search tool, and I use the API of another site to do this. The URL I’m using to make the request is:…
-
-1
votes0
answers21
viewsCreate a "like %" query from a JSON
Hello! I am basically a list of users of an external API and I need to process this data in my queries. I need to search by name as if I were doing a query in SQL but I am not able to handle the…
-
-1
votes0
answers7
viewsHow to get token via test with jest
I’ve been having trouble finding a solution when developing automated testing with Facebook jest when it comes to getting token to test authentication. With this code does not return the token. But…
-
-1
votes0
answers17
viewsMigration of Merge Graphql Schemas
How do I join all the SCHEMAS that have been created. import { mergeTypeDefs } from '@graphql-tools/merge'; import { loadFilesSync } from '@graphql-tools/load-files'; import path from 'path'; const…
-
-1
votes0
answers29
viewsProblem with the CORS
I’m developing an api for an education platform, and so created my private and public routes. The public are for creation and validation of token, then use it to access the routes but Cors, for some…
-
-1
votes0
answers19
viewsHow to search two req.query array referencing only one field in the nodejs api, in which way the code uses the second assignment?
By assigning two req.query to the same filter field for the array, it only takes the second, how can I use both req.query using ranges as search ? exe: req.query.competencia_initial = '201901'…
-
-1
votes0
answers29
viewsProblem with asynchronous nodejs
I’m with a method in a class that calls the method another class and after that he gives a console.log of the return of this method. But this console.log is executed before the function call causing…
-
-1
votes1
answer38
viewsHow to handle dynamic payloads in Node.js?
Hello, I would like to know what would be the best way to model the receipt of payloads with dynamic data, IE, I can sometimes receive a request with 3 fields, other, with 5, etc. For example, in…
-
-1
votes1
answer20
viewsError Downloading node_modules. 'Node' is not recognized as an internal or external command, a operable program, or a batch file
I have this problem that I can’t solve at all. I downloaded the Github repository and it worked normal, however, I had to delete it and clone it again, but by doing so I can’t download the…
-
-1
votes0
answers7
viewsI need to take information from the nextAuth service profile function and forward it to the browser
Hello I am making an app that uses as authentication a backend of its own, and in the authentication with google I am using next-auth, it sends the tokenid to the api via post and with that the…
-
-1
votes0
answers14
viewsCkeditor Undefined no Nodejs
I’m studying Nodejs and I have a problem with Ckeditor. I am unable to pass the text information written within the textarea to the backend. He creates the id within the materials, but the content…
-
-1
votes0
answers10
viewsReaddirsync does not recognize folder - Bot for Discord
Basically, I am working on a Discord bot, and at the moment I am creating the Helder command, but for some reason, readdirSync does not recognize the folder that stores the files of the commands…
-
-1
votes0
answers32
viewsI made a calculator in JS with the following parameter list to return the following results
Today I tried to create a calculator with the following function called with the following parameters : calc(1, 4) -> retorna 5; calc(1, 4, 'sum') -> retorna 5; calc(6, 2, 'mul') -> retorna…
-
-1
votes0
answers18
viewsProblem using environment variables with Sequelize
I’m having a problem when I try to connect my database via Node setting environment variables. The variables I’m trying to set: file . env DIALECT_KEY='postgres' HOST_KEY=127.0.0.1…
-
-2
votes2
answers5067
viewsHow do I get back to old versions in nodejs by npm?
I need to go Node.js version 5.10.0 to be able to use firebase Hosting
-
-2
votes1
answer91
viewsAngular for creating layout
Good morning guys! I am starting to study now angular, Node and typescript (not in that order) and I have arisen the following doubts: 1- I noticed that to run the angle, you usually use Node for…
-
-2
votes1
answer123
viewsConvert Encoding to JSON
Boa Tarde Galera, I have a question, I have a file in JSON, which is with some unidentifiable characters, is there any method for me to set the encoding of it in UFT-8? Because I need to play this…
-
-2
votes1
answer237
viewsI cannot connect the Mysql Nodejs database
It should show the table data on the screen, but does not return anything. Where I am missing? module.exports = function(app){ app.get('/noticias', function(req, res){ var mysql = require('mysql');…
-
-2
votes1
answer861
viewsNodejs integration with DLL
I need to make Nodejs read a DLL to create a Rest API. I have the file . dll, but I don’t have the source code, this . dll is in a Chinese C# program. What I want is to use this . dll by creating a…
-
-2
votes1
answer126
viewsIs it possible for an Laravel API to consume a Node API and that Node API to call that same Laravel API in a request?
I have a client (front-end) that consumes an endpoint in an Laravel API, this endpoint communicates with an API in Node.js and this API in Node.js calls Laravel API methods (which called the Node…