Category "node.js"

ReferenceError: "_" is not defined

recipe = new Recipe(_.pick(req.body, ['name', 'tag', 'recipe'])); await recipe.save(); }); error: recipe = new Recipe(_.pick(req.body, ['name', 'tag

Socket.io and Redis Adapter same rooms and different servers

We are creating a scalable real-time collaborative text editor. The client (frontend) code is written in React.js, and the server (backend) code is Websockets (

UnhandledPromiseRejectionWarning: BSONTypeError?

I face a problem in the node.js project. error is likes, (node:9836) UnhandledPromiseRejectionWarning: BSONTypeError: Argument passed in must be a string of 12

'SyntaxError: Cannot use import statement outside a module'

I have updated by configuration to node 16.15.0 on both local machine and server. The code is running fine on local machine but on server it gives an Error - "S

Discord js 13 button edit permission channel

When a person sends my command, a channel is created that only they have access to. Also, when creating a channel, a message is sent with the "accept" button, w

Pipedream, getting trigger event data with sync function

i'm wondering hot to get pipedream to do an nodejs action, but i need to use the trigger event (HTTP POST) to get some info, the thing is that i cant wonder how

Populate Failed immediately a ref was indexed in Mongodb via Mongoose Schema

I had a Post Model with a ref as below const mongoose = require("mongoose"); const PostSchema = new mongoose.Schema( { _id: mongoose.Schema.Types.O

Metro has encountered an error: While trying to resolve module `@apollo/client`

I am trying to install GraphQL into my React Native app and in doing so, I was given this error message. I have confirmed that the file actually exists and have

Can't install nodejs in Termux on Android

When I do pkg install nodejs or pkg install nodejs-lts it gives me a this message: Checking availability of current mirror: ok Ign:1 https://dl.bintray.com/gri

Cannot access to WSL2 port opened via IPv6 from Windows host

I have a node-server running at WSL2 Ubuntu-20.04. netstat -tulpn in WSL shows the following ports: The ports specified as 0.0.0.0:8080 can be accessed in both

Setting a title and favicon for non-html files on a website

Is there a way to set a title and favicon for non-html files on a website? For example, a link like https://example.com/files/image-or-something.png. By default

pm2 can't find package.json when start

I try to start my app on VPS.I can start my app in terminal, but when I work with pm2 , I get the error 0|gentle-s | Error: Cannot find module '/root/my-app/ind

npm: Replacing one package from dependencies with a fork (possibly using git)

I'm using terser, which requires esprima. Esprima has been abandoned, so I'd like to replace it with the fork esprima-next. However, no method which I've used t

Would like to write a javascript that helps me to find documents in a folder

I would like to write a js for an offline website (located on a local Windows server or any other server). It's supposed to look for files like PDFs in several

NodeJS app build is successful (Render) but Application Error in render at the launch. Status is failed, no error logs

Status shown failed but in console log deployed successfully & server is up. Image for your referance app url

Facing issues with npm i and installing npm packages

Hi I'm trying to install NPM package via NPM I, however I constantly get this error: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ER

I am trying to connect and read data from mysql in node js and react project with clinet and server setup but

**I am trying to connect and read data from MySQL database in node js and react project with client and server setup but unable to get success, here is the code

Nodejs readstream, what value should I use for highWaterMark

I have a copy function that uses createReadStream and createWriteStream to give me progress events during a file copy: createReadStream(source, { highWa

Embedding issue / All messages send at once

I'm having this issue where all my embeds are together. How do I separate them? My issue is that every time I run the embeds send together, I know the issue bu

Command prompt pops up and closes

My command prompt opens up randomly for like 10 seconds and then closes. The title says npm. I don't know what is causing it or how to solve it. Do you guys hav