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
answer61
viewsSpring Boot Map Static Files (React)
My question is, how do I map static files, for example in Nodejs using Express, I can: app.get('*', (req, res) => { res.sendFile(path.resolve(__dirname, '../build', 'index.html')); }); So all…
-
-1
votes2
answers87
viewsHow to use rowCount to limit the number of records in a postgresSQL database using Node js?
I’m using the script to do this, but I get the error Internal server error. Anyone knows what I’m doing wrong? var sqlQtd = db.query(`SELECT COUNT (*) FROM segunda`, function(err, result){ return…
-
-1
votes1
answer39
viewsDisplaying the database error in fetch
Good morning. I want to display the 400 error on front(RN) that back(Node) provides, using fetch. function add(){ fetch(`http://localhost:3000/AOTT7C1TT75a8s5RH1TR/${desc._id}/skaoskao`,{ method:…
-
-1
votes1
answer54
viewsI cannot add a line to a table using db.run() in sqlite3
I have already installed Node Static, to fix the first time q error appeared, which seemed to be related to a server response delay, but msm after I took this delay, the error kept appearing,…
-
-1
votes1
answer144
viewsMy package.json is giving error!
I’m having trouble with my package.json. It is giving direct error, and when I open the Node to make the file, also gives error as shows the attached photos.…
-
-1
votes1
answer690
viewsAttempted import error: 'Yup' does not contain a default export (Imported as 'Yup'). NPM
I am creating a site with authentication service and in it I intend to use Yup, an NPM module. I installed everything right but when I start the application it appears: Attempted import error: 'yup'…
-
-1
votes1
answer707
viewsVscode does not show the node_modules folder in Explorer
After the installation of Express I noticed that Vscode in its interface no longer shows the folder inside the project in the Explorer tab, often I need to change something in node_modules and I am…
-
-1
votes2
answers35
viewsAccess static link on Node using authentication
In my backend I have this: app.use('/files', express.static('upload')) Generating static image and pdf links for users to access. In my frontend I put a button where the user can display the static…
-
-1
votes1
answer599
viewsHow to configure Node Express in the Angular 6 project?
I am to send a simple project that is working perfectly on my local computer, and I need to send it to the Heroku server, for this it is necessary to configure a file that will simulate Node Express…
-
-1
votes1
answer26
viewsI am unable to iterate the array
I would like to popular this array with the Category object I get when I query findById. But the variable loggedUserCategories appears as an empty array in Sponse , however, I can visualize the…
-
-1
votes1
answer31
viewsProblem capturing object value
I’m doing a database search (mongoDB) so it returns me an array, I just wanted to be picking up an array object but I’m not getting it. app.get("/", (req, res)=>{ Gift.find().lean().then(gifts…
-
-1
votes1
answer48
viewsHow to Restructure a JSON
I created a Node js API connected to Oracle 12.1.0.1.0c where I connect and do the request as follows through the dbconection.js file as shown below: const oracledb = require('oracledb'); const {…
-
-1
votes1
answer310
viewsYarn Doesn’t Start Development Server
Hi, I’m developing a site with React, but when using give command yarn start, he doesn’t incite my server.…
-
-1
votes1
answer46
viewsJavascript block loop logic
My code has an array with numerous objects, that abjects which are URL’S, with which I loop through this array and make a request for each url of the array. But I need my loop to go through the…
-
-1
votes1
answer67
viewsUncaught Error - Sending email using nodemailer and Angularjs
I have been racking my brain for some time trying to create a contact page where the user can send an email. I’m new to Ode, and that’s why I’ve been through some trouble. At the moment I can’t get…
-
-1
votes1
answer45
viewsReverse dialogue on Watson’s integration with Telegram
When starting the conversation with Watson the messages appear reversed, first he should say: Hello, Alexandre, I’m Jairo! only after saying: I’m here to remind you [...] This integration was done…
-
-1
votes1
answer742
viewsNODE.JS 'Connectionerror with MSSQL
It’s the first time I’ve worked with javascript and Node.js. I have no idea what the error might be or how to make the connection, my problem initially arose here:…
-
-1
votes1
answer39
viewsWhat is different from Consign’s "include" and "then" methods?
I’m using the Consign library in a back-end creation exercise on Node.js. Part of the code appears like this: consign() .include('./config/passport.js') .then('./config/middlewares.js')…
-
-1
votes2
answers542
viewsInsert multiple records into Mysql using NODEJS
How do I add multiple records at once in Mysql by passing an array of, for example, products? HTTP-POST request, where products is an array with an x number of products. FRONT-END…
-
-1
votes1
answer2627
viewsHow to work with Date & Time in Nodejs, Mongoose and Typescript
Good morning, you guys, I come from the Java world and am starting in Nodejs. I’m having a hard time understanding how to work with dates and times at Nodejs. This is an example of the model I want…
-
-1
votes2
answers31
viewsDifferent results doing what I think is the same thing ( Mongoose js )
I have that code var questionscount = await Question.find({ $or: [ { titulo: { $regex: termo, $options: 'i' } }, { corpo: { $regex: termo, $options: 'i' } } ] }).count() console.log(questionscount)…
-
-1
votes2
answers28
viewsRename files to include a prefix
I need to rescue some files with any name (Ex: "João") and rename them including a prefix ("RJ-João"). I managed to list but I’m not able to rename the files: const testFolder = './teste/'; const fs…
-
-1
votes1
answer14
viewsHow to create an endpoint that downloads a local file as soon as requested in Nodejs?
I have a file in my project that I need to make available for download, through an endpoint that when requested will automatically download, but I can not use any framework, only Nodejs.
-
-1
votes1
answer30
viewsSelection of two files with Input type file
I have this following situation, I have these two files to upload with input type file. But here’s the rule. I can only present to the user the files that have the SHP extension Where it can select…
-
-1
votes1
answer29
viewsHow to format the date to the Brazilian standard in an attribute of type "DATEONLY" using sequelize?
I own a model with a date attribute of type DATEONLY, when I step into the body of the request 01/02/1999, and the return is "date": "1999-01-02". How can I format for the Brazilian standard? date:{…
-
-1
votes0
answers15
viewsEmail Confirmation (Strapi)
I activated the Strapi email confirmation function, but whenever I register a user "http://localhost:1337/auth/local/Register" is giving: {"statusCode":400,"error":"Bad…
-
-1
votes0
answers36
viewssingle tests on Ode with jest doubt expect
What should I put on expect to check if the product has been deleted once it returns nothing? it('should be able to delete a product.', async () => { const product = await…
-
-1
votes0
answers27
viewsPlay audio from url Discord.js v13
How do I play audio from a url with Discord.js v13. I used this code and it didn’t work. const connection = joinVoiceChannel({ channelId: voiceChannel.id, guildId: message.guild.id, adapterCreator:…
-
-1
votes0
answers8
viewsApp structure with various USER_HOLES
I need to develop an angular design that will have various types of user. My question is whether to create two/more applications in the same angular Workspace, using the library system for the…
-
-1
votes0
answers7
viewsLambda Schedule is running incorrectly
Good afternoon staff I have a lambda Schedule on my aws account that was supposed to run every weekday from 10 to 17 Monday to Friday rate: cron(0/30 10-17 ? * MON-FRI *) #executa A cada 30 minutos…
-
-1
votes0
answers5
viewsNodejs Botbuilder with Puppeteer
I have problems with the bot in MS Teams when I try to wait for the page loading using Puppeteer’s '.waitForTimeout ()' method, I get a message like this one: (Unable to access the app. Try Again)…
-
-1
votes1
answer119
viewsAngular: Webpack has been initialised using a Configuration Object that does not match the API schem
I started having this error in my app at Angular 7, already tried to remove module folder, install, remove cache and nothing, the error remains. Invalid Configuration Object. Webpack has been…
-
-1
votes1
answer75
viewsAsynchronous mysql queries in nodejs
Hello, I have a code in nodejs with mysql database. on one of the paths referring to the path(path) need to fetch all readings from 3 sensors (each sensor is a table) that have the path field equal…
-
-1
votes1
answer240
viewsRequest returning Cannot PUT with express
Greetings dev’s my route file is like this: const express = require('express') const routes = express.Router() const TodoController = require('./controllers/TodoController') ...…
-
-1
votes1
answer311
viewsService for sending SMS or Push Notification
I have an application developed in Angular 7 that is in the final stages of development. This application makes use of Firebase services, one of which is the Cloud Firestore. I’m looking for a way…
-
-1
votes1
answer830
viewsHow to export a Node class?
insira o código aquiVersion of Node 10.5.3 I am trying to export a class, to use it in another file. I have seen several examples on the internet and none of them helped me. Below is the class I…
node.jsasked 5 years, 4 months ago Samuel Ribeiro 11 -
-1
votes1
answer137
viewsValidationerror: companies validation failed: county: Path `county` is required
I can’t see the mistake that keeps me from POST (store the data in the database). Also, in the form when selecting a country he should only take his cities, instead he calls all cities and…
-
-1
votes1
answer856
viewsYarn returning error while trying to add "Cors"
This is Devs :D I’m having a mistake that’s bothering me a little... When trying to add the "Cors" package by Yarn, the terminal returns me the following error: $ yarn add cors yarn add v1.16.0…
-
-1
votes1
answer74
viewsGET method does not access data in mongoDB
I created schema.js to consume data from a small database in Mongodb const Mongoose = require('Mongoosis'); //create schema var Schema = mongoose.Schema; var restorationSchema = new Schema({…
-
-1
votes1
answer245
viewsError installing sudo-free NPM packages
I have this difficulty, I wonder if it would be possible to run without sudo MacBook-Air-de-Alan:~ collins$ npm i -g react-native-cli npm WARN checkPermissions Missing write access to…
-
-1
votes1
answer401
viewsFill form fields with API data
Good morning, I have a form where the user enters the code of a product. When entering the code an API is triggered and it returns the data of the informed product. My doubt now is how to make the…
-
-1
votes1
answer87
viewsError while creating user
I am having the following error when trying to create a user in my api Validationerror: address.0.status: Path estado is required. , Address.0.city: Path cidade is required. ,…
-
-1
votes1
answer333
viewsHTTP GET - Jquery - Node.js request
First of all, I wanted to say that I’m developer . net, so I’m kind of lost in what I’m doing. If I understood correctly, I downloaded Node.js and inside the Node.js prompt I gave a CD in the folder…
-
-1
votes1
answer62
viewsReduce with Sort
I need to reduce a array, adding the values (I was able to do the code below), now with this reduction I need to do a kind of a SORT to then catch the 3 biggest and the others I’ll make like an if…
-
-1
votes1
answer364
viewsUnhandledpromiserejectionwarning: Error: Cannot enqueue Query after fatal error
I have this mistake and I couldn’t find any questions on Stackoverflow that would help me... the error is being generated provable because of a promise Index.js const path = require('path') const…
-
-1
votes1
answer82
viewsHow to do a duplicate email check in the Put (update) method when some other user already has the same email registered?
In the back-end of the application in Ode, I want to do an e-mail check when some other user already has the same email registered. Already works well when using with the POST method, however, when…
-
-1
votes1
answer251
viewsphp sending via Curl nodejs
Good evening, I’m 2 days trying to send Curl php data to nodejs when I do out the Curl works... but I needed it to go this way.... attempt 1 php: { $this->ch = curl_init();…
-
-1
votes1
answer220
viewscheck if array element has a letter
I need an algorithm that reads an array, and returns me if one of the items has a letter... if one of the items has a letter, I want it to return me "qualitative", if all the elements have only…
-
-1
votes1
answer138
viewsNode.js First steps, don’t know how to start
I’ve been dedicating myself to Javascript for some time, looking for various ways to learn, recently I came across the callback functions, usually used when using javascript on a server instead of…
-
-1
votes1
answer267
viewsLogin with CPF with Nodejs, Reactjs and Mongodb
Well I built an API for registrations in the remote mongodb database (Atlas), I can register, the intention is to offer a form for the user data(Name, Cpf, phone) and then do the CPF, made the login…