Category "node.js"

I want to find the last object which i'm posting in my database without any condition but i can't find any method for that

Data.findOne({}).then((respp)=>console.log(respp, "find one")) Like I have this method this is returning First object and if I apply a condition then i can

Can't run a TS node + ES app - either get `ERR_UNKNOWN_FILE_EXTENSION ` or `new ERR_MODULE_NOT_FOUND`

I'm trying to compile my code as ES code (using "type": "module" inside package.json and "module": "esnext" inside tsconfig.json). I can't run it using any of t

How to sort data based on entry of parent collection in mongodb using mongooose package

How to sort data based on entry of parent collection in mongodb using mongoose package. My schema is organised as given below Profile Schema const mongoose

How to use nock in order to mock Firebase/Firestore in NodeJS?

I have a REST API which written in NodeJS. The REST API gets a file and information and then uploads the file to the drive and stores the information inside my

gm imagemagick passing in convert arguments as a string

I'm trying to pass the convert arguments as string to in() without success. works fine if I run this: const GM = require('gm'); const gm = GM.subClass({ imageMa

Version of Node.js which not supperted by hardhat, but I have LTS version of node

I installed nvm in Ubuntu 20.04. Then using nvm I installed node and npm. The general task is to use hardhat in my Solidity project. I created npm project and i

Node and Crypto: this[D].init is not a function?

I am learning NodeJS and trying to import and use a method from the crypto package. However, right out of the gate, I get the following error: TypeError: this[

Why does my Selenium script work only every other time?

I think I should start off by mentioning I have Mac OS and am using Safari browser. This script is a web-scraper that is supposed to search for a given type of

Cannot understand difference between the two ip addresses in relation to hosting?

I have used IIS to host a nodejs API in windows 11(followed these blogs: blog-1 and blog-2). When following blog-1, setting the IP address to IPv6(i am not sure

Sequelize transaction with optimistic locking is locking the whole db

I have an API coded with Node.js and I use a SQLite database with Sequelize. When I make updates, I use a transaction to rollback if something failed during the

Express.js backend not saving cookie to Nuxt.js frontend

I've built an authorization server with Express.js that works when testing with Postman where it saves the access and rotating refresh token as signed cookies.

Pacman upgrade causes conflict with not present packages

I'm on Arco Linux(the most basic one). I have installed the nodejs package with pacman. Now when I run sudo pacman -Su I am getting nodejs-lts-gallium and nodej

Why is Buffer assignment triggering an unsafe assignment error?

I have a TypeScript project that is leveraging ESLint. I have a class that utilizes a Buffer as a class attribute. I want to be able to set the buffer as part

Upgrading Jest to v28 - Error Test environment jest-environment-jsdom cannot be found

Has anyone successfully upgraded to latest Jest version 28.0.0? I'm receiving an error: Error: Test environment jest-environment-jsdom cannot be found. Make sur

Why are cookies not sent to the server via getServerSideProps in Next.js?

Cookies are not sent to the server via getServerSideProps, here is the code in the front-end: export async function getServerSideProps() { const res = await a

How to convert m3u8 file to mp4 video using nodeJS with a remote S3 input

The objective is to convert .m3u8 file(hls stream) to .mp4 video inside my NodeJS application. I've tried doing the same using ffmpeg on console and that works

how to pass a variable to REST API with NodeJS

I must use NodeJs to set different API routes to provide front-end functionalities. I have designed the server as : routes=> controller => models The snip

Is there a NodeJS equivalent to print a stack trace like Java's SIGQUIT handling?

Can I get a stacktrace from an arbitrary running NodeJS program, preferably without altering the code itself? I can do this trivially for Java but can't seem to

cypress test asserting a filtering operation on array of objects expecting undefined

I have a cypress test over an API. When I do cy.getUnits(u.email) I'm expecting a 200 OK response similar to this in the body of the response {   &ld

Does npx no longer do install-less run?

From the nodejs.dev site: npx allows you to run that npm command without installing it first. If the command isn't found, npx will install it into a central ca