Category "node.js"

Return the data of a model directly instead of a dictionary Express.js and Mongoose

Probably the title isn't very clear and is a bit confusing, and to be honest, I do not really know how to ask this question since I'm new to JavaScript and Mong

I am making a discord.js bot and I want to know if there was an error

I am using the following code to figure out if there was an error. But I want to not run something if there was an error. I have tried to look it up and I could

How to link an old version of node in mac using homebrew

I am trying to link to an older version of node using homebrew in my mac (because netlify doesn't work with v17 - which is my default). When I search which vers

Error only shows the first time using Axios on getInitialProps

Hi everyone i've an issue fetching data with Axios Let me explain to you what im doing: i've my FrontEnd made in NextJs but my BackEnd was made on C# then when

ESLint: Plugin "react" was conflicted between

I have a React app inside a monolith npm component package. The React app serves as a demo site which consumes this component package as an integration step ove

How to make a button event handler in discord.js V.13

I create a function to send an embed message with a button and now I would like to create an event handler to detect when the button is clicked and execute a fu

Openpgp Encrypt with PGP

I am trying to encrypt a message using PGP but I am getting an error that states: ReferenceError: TextDecoder is not defined at Object.decodeUTF8 (node_m

How can i fix Error: Cannot find module. Using sequelize, express, node and mysql

Can some one help me? Node v16.15.0 "body-parser": "^1.20.0", "express": "^4.18.1", "mysql2": "^2.3.3", "path": "^0.12.7", "sequelize": "^6.19.0", "sequelize-cl

Hardhat: ProviderError: The execution failed due to an exception

I'm deploying contracts with hardhat, but cannot use address type in contracts ProviderError: The execution failed due to an exception. at HttpProvider.requ

Integrate jsdoc into docsify

Im trying to document my node.js/javascript application. The frontend is a vue app & backend a node.js app. I use jsdoc to document classes/modules etc. and

Formidable returns TypeError, ERR_INVALID_ARG_TYPE: The "path" argument is undefined

I'm having trouble uploading files using formidable. I'm on Windows server 2016. My code, which in its entirely is shown below, is based on https://www.geeksfor

How to get a JWT token from one server to another in order to validate APIs which is running on different ports in node & express?

I have two modules in two different server i.e., User and transaction module. User module has one Login API which generates the JWT token, Now I want to send th

HTTP Response Error - Firebase + Node JS 16

I've reduced my code to the bare minimum to troubleshoot why I receive a response error when I put a HTTP request in. I first receive a status 200 message upon

How to send files using socket io in react js, node js and store in mysql database?

I am building a chat application like discord, I can successfully send a chat message, and i am trying to send emojis, files like image, pdf, docx, links. How t

How to get Digitalocean environment variable?

I set an environment variable in Digitalocean with token, but I don't understand how to use it in the code. I scrolled through the docs, but didn't get anything

Where is node-redis v4 documentation/migration guide?

node-redis refactored its API in v4 to support Promises. For some reason, they also decided to change the signature of most commands, which now don't obey any a

cann't decrease a value by one in the UI with node.js mongodb, react

I am trying to update a value in the UI. When I click to update, I have a button that will decrease by one In the database and be displayed in the UI's quantity

Mongoose - get all requried fields only from the schema

I want to apply validation on controller level similar to what we have in a Form Request in Laravel but I want that in Node JS. I want to know the required fiel

How to build a TypeScript shell command that installs portably and globally?

I would like to build a command-line tool written in TypeScript that becomes available in the $PATH when installed. My requirements: I can run and test it from

How can I solve a "MongoError: E11000 duplicate key error collection" error in Mongo?

I have created a new Mongo collection to a new project, but when I try to create a new user, I get the following error: MongoError: E11000 duplicate key error c