Collect all kinds of node.js programming exceptions and fault solutions.


access and package external files in an electron application

I am building my first electron app that has application content (a JSON file).
My problem is that I cannot access the application content after packaging with electron-build.
I added the JSON fi...


grpc Trying to connect an http1.x server

I have Node.js grpc server and Node.js grpc client. My grpc server is insecure server, and I already tested my grpc server using my client in local.
But I deployed to kube using nginx ingress cont...


AWS Lambda Cryptic Node.js error: Unknown application error occurred

I recently updated my lambda Node.js runtime from 8.x to 12.x. I upgraded lots of dependencies and optimized the bundling with webpack and the deployment process.
BUT, I started to notice sporadic ...


How to correct this error? usemin not found

I tried to run npm run build after installing rimraf,copyfiles,imagemin, usemin-cli, cssmin, uglifyjs and htmlmin. And then editing package.json file.
But I got the error
sh: 1: usemin: not found


Is there a way to allow my bot to check DMs and post them in a channel in my server?

How would I make my bot send a message to a specific channel with the message when someone DMs the bot? I was thinking about webhooks, but I’m not sure if that’s the right way to go.


Mongo NodeJS project() is not a function

I wanted to exclude some attributes from the result. I read the specification: https://docs.mongodb.com/manual/tutorial/project-fields-from-query-results/ - I need to use project function. So I cha...


My google action works perfectly when tested on the test console but does not on the actual device

Specifically, after the action shows a Carousel and the user selects one item, the actions fails to respond on the android device and I see no error in the firebase logs.
The action works as inten...


How to make an application command?

Is there a way I can make a command such as -apply and the bot sends them a DM starting that you've started your application! Then it asks a question, and the person answers, then it goes to the se...


Getting error while running node js file system code tried almost every solution but all are not working for me any easy solution?

internal/modules/cjs/loader.js:985 throw err; ^enter code here
Error: Cannot find module 'C:\Users\DELL\Desktop\node js programs\file'
at Function.Module._resolveFilename (internal/modules/cjs/lo...


How to setup a viberbot webhook for heroku deployed nodejs bot?

I have problem of setting up web hook for my chat bot i made using nodejs. Which is deployed on Heroku.
The app uses the following architecture :
const http = require('http');
const port = process....


Cannot use import statement outside a module in .spec.ts files NodeJs

For unit testing, I use mocha + chai.
I run the command with "test": "mocha --require ts-node/register 'src/**/*spec.ts'".
When I use import in *spec.ts files (for example import { expect } from '...


No overload matches this call when iterating through node.js process events

I am using a library that adds uncaughtException and unhandledRejection listeners by default. I wish to remove them.
Here's my code:
["unhandledRejection", "uncaughtException"].forEach((eventNam...


Cloudflare SSL: Express Not Working After SSL Appli

Please consider my circumstance:
I have created a backend API on port 8880 in Express.js in HTTP
I have created a frontend website in Next.js on port 80, also in HTTP.
I signup with cloudflare t...


npm run dev fails : ValidationError: Invalid options object

Currently learning Vue js and express js through some tutorials, I am still newbie regarding these technologies.
Anyway following the tutorials I am building a small project in which I have a fol...


How to import and utilize P5.Sound in Vue?

I have been trying to make a music visualizer app using Vue and P5, and after tinkering with P5 using this article as my guide (https://medium.com/js-dojo/experiment-with-p5-js-on-vue-7ebc05030d33)...


How can call razorpayX api using npm request?

Hello there I am working with razorpayX first time I need to create contact razorpayX API(s) using npm request here is the documentation I tried my self but every time it's return "api key need for


Command 'pm2' not found

i recently cloned my nodejs express app on ec2 ubuntu instance. I ran npm install pm2 but it didn't had write permissions. So I ran sudo chown _R $USER /usr/lib/node_modules.
After that PM2 got


MERN app deployed on Heroku fails to respond to requests with code H12 status 503 (timeout)

Locally, the app works how it should, although after somewhat "tougher" deployment it doesn't fetch any data from my MongoDB.
It is a simple "blogish" app that fetches posts alo...


Switching to a new tab using browser.pages() in Puppeteer

I am trying to do this:
Open Google
Search "hotels in london"
Click on "View 3810 hotels"
---new page opens ---
Click on "Learn more" button for the first hotel
...


Puppeteer not running on dedicated GPU

I'm trying to get this to work.
My setup is a Ubuntu 18.04 with two graphic cards, one is onboard, the other one is a NVIDIA GPU. I have a monitor connected and the $DISPLAY is set to :0
My applica...


Need help in VS code with npm

I need to use 'ng serve' to run something but when I try to do sudo npm install I get this error:
npm WARN bootstrap@4.5.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must instal...


Application Bot Discord.js

So this code sends a DM to a user asks the user some questions my goal then is to send the application back to a specific channel not sure how to do that any help i know you have to user the channe...


How to recalculate all formulas in excel file through Javascript?

I am trying to create a web app to open excel file on web page and I am using 'xlsx' module for this purpose.
The problem is when I modify any content through 'xlsx' module. Sheet formulas do not r...


How to resolve error: not assignable to parameter of type '"disconnect"'?

I have the following test in which I would like to emit a particular event, namely an unhandledRejection process:
describe('Processes Tests', () => {
afterEach(() => {
sinon.r...


How to only get the "title" and "main content" of a page using puppeteer?

I'm trying to create a clone of getpocket.com for learning. On that app, every saved link gets converted into a markdown; and it seems like the it's a filtered content with only the page title and ...


Deploying a node.js app (discord.jd bot) on Heroku causing an error

I'm trying to deploy a discord bot on heroku. It works for about 1-2 minutes and then there is an error:
2020-08-10T10:05:17.228802+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process f...


How to generate a JSON Schema?

I would like to generate a schema from a json object.
var GenerateSchema = require('generate-schema')
var schema = GenerateSchema.json(request.body);
Request.Body
{
"type": "


Bulk Upsert using DynamoDB

Is it possible to do bulk upsert of items in DynamoDB similar to how MongoDB bulk write can do this?
I have this function in MongoDB looking to do something similar in DynamoDB:
async bulkSync(
...


Secure cookies not being set

I can't seem to set the cookies if I make the api call from Netlify, but with Postman it works.
I don't understand why.
My code looks like this:
router.post('/login', localAuth, async (req, res) =&...


How to use wss protocol in socket.io?

Based on my searches on the internet and going through multiple links on stack overflow,
What I have understood is this:
socket.io uses wss under the hood when we use https in the connection,
edit(in


How to pass configs from config service to Nest.js decorator?

I use @UseInterceptors with FilesInterceptor from @nestjs/platform-express. FilesInterceptor allows me to pass some configs (like files storage folder). I would like to pass not exact values (e.g. '


Axios Vue app only Post Request Network error

Using the Following Stack Express,Vue,SQL,Axios
GET request is working fine in postman as well from Axios
POST request created error in both attached screenshots
To make sure the Backend is workin...


Trying to Run the node script for revenue distribution for Waves nodes and leasers. But getting the socket hang up error,In HTTP call of node script

I Used this GitHub repository as a reference. https://github.com/plukkie/WavesLPoSDistributer
In that, config.json file is setup with all the details related to waves node. But' when i'm trying to ...


Which hosting service is best for angular 8 application

I have developed angular8 application website using MongoDB,Express,Angular8,NodeJS [MEAN]. So which hosting is best TMD hosting or GoDaddy or any other hosting services are there? Also Which plan is


Deployed Nodejs service does not work on Azure Web App

I've created two pipelines: build and release for Nodejs app.
Here is the link to nodejs app repo: azure web service
Here is the tasks for build pipeline:
Here is the wwwroot folder structure:
So...


PM2 not keeping node.js applications online 24/7

I believe PM2 was supposed to keep node.js applications 24/7. However, once I shut down my computer my node.js application (a discord bot) goes to sleep. Does anybody know how to fix that? Thanks.


Angular Service with Azure Cosmos

I am really new to Angular. I am trying to create a service which i want to consume in my angular component. While doing so i am getting below error.
Below is my code which i am writing
import {


React performing slow on extreme socket updates

I'm building a trading application and using node on the server side and react on client side.The current issue which I'm facing is regarding react performance on very frequents updates.
My process...


How to set timezone in NodeJS?

I am working on NodeJS project. In local server it picks timezone locale: 'en-IN' and in live Amazaon EC2 server it sets timezone as locale: 'en-US'.
How can I change the local server timezone to f...


Getting error testing readstream response with Jest

I am getting timeout error while testing a function that returns readStream from google cloud store.
// Test case
import { createResponse } from 'node-mocks-http';
it('getImage from google cloud st...


Nodemon Error: listen EADDRINUSE: address already in use :::3000

I'm working node app and my nodemon throws error of:
Error: listen EADDRINUSE: address already in use :::3000
every-time if there is change in files.
I've searched a lot and most of them suggest to


Why this foreign key is not working for delete action in knex?

I have two tables, addresses and users, each user has an address, there is a column 'address_id' in table users that references a row in addresses table. But, when I delete a user, the address row is


puppeteer passes incorrect value to textfield

So I've developed a web scraping tool for the website "de.indeed.com" using puppeteer.
It used to work perfectly, but the website has been updated and now it doesn't work as flawlessly an...


Elastic APM: Mongoose spans cannot find transaction when used with apollo/graphQL

I am using Elastic APM. I find that mongoose integration is not working when used with GraphQL/Apollo Server somehow. I wrote an apollo-server plugin like this to start/stop transactions:
import ap...


Starter project: webpack vs ts-node?

I saw starter projects for nodejs in Github, some of them using ts-node to run typescript files with node, and others using webpack to compile with typescript plugins and using nodemon-webpack-plug...


how to get Jest --watch to run on changes to JSON/YAML files?

I'm running some jest tests with --watch that depend on data fixtures. I want the watch run to trigger when I edit my data files, not just the code.
I've added the following to my package.json


how to create parent/child associations in sequelize?

I have a Employee and their dependents model defined in sequlieze. I have an employeeId foreign key column defined in the dependent table ( see my model class below) . but when i try to execute fol...


Docker CMD with environment variable while running node application

I need to pass an environment variable to node like below.
RAZZLE_ENV=production node build/server.js
How I can achieve this with docker CMD command. My current config is like this:
CMD [ 'node', ...


Using i18next in Node.js models

I want to use i18next in a Node.js + Mongoose + MongoDB based Web API application to return localized error messages. Here's how I initialize i18next in app.js:
const i18next = require("i18nex...


With next.js, why did I suddenly start seeing Module not found: Error: Can't resolve 'fs'?

I changed nothing, but am using "next": "9.4.4", and I see:
Module not found: Can't resolve 'fs' in 'web/node_modules/graceful-fs'
Could not find files for /app/d/[id] in .next/...


Next