Questions tagged [node.js]

Node.js is an event-based, non-blocking, asynchronous I/O runtime that uses Google's V8 JavaScript engine and libuv library. It is used for developing applications that make heavy use of the ability to run JavaScript both on the client as well as on the server side and therefore benefit from the re-usability of code and the lack of context switching.

181,999 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
50 votes
4 answers
8k views

How to debug Angular universal?

I am using Angular Universal Starter repo. In angular 4 universal for ssr we could debug browser and node part of application in dev mode(see console), but now I do not see way to debug node part. I ...
dimson d's user avatar
  • 1,582
29 votes
2 answers
4k views

Unable to import webpack-bundled UMD library as an ES6 import

I've authored a javascript library using Webpack. The entrypoint someClass.js looks like this: import x from './x' /* several more imports here */ class SomeClass {} export default SomeClass; My ...
StillFiles2's user avatar
28 votes
1 answer
671 views

StriderCD global post install fails on bower access to $HOME/.config $HOME/.cache

I am trying to work out the best way to install StriderCD globally. I installed node and npm via the global-enabled fork of nvm, and all paths are working fine for other builds, but none of them ...
notbrain's user avatar
  • 3,376
27 votes
2 answers
4k views

Firebase Cloud Functions Error: connect ECONNREFUSED

I am trying to create a Kik Messenger bot according to their API using Firebase Cloud Functions. I am using Blaze Plan. I am trying to reply to a message that my bot received. I can receive messages ...
bennygenel's user avatar
  • 24.2k
26 votes
2 answers
3k views

launch dedicated DevTools for Node.js from command-line

I wondering how to launch "Open dedicated DevTools for Node" directly from the (windows or linux) command-line, without using chrome://inspect url then Open dedicated DevTools for Node button ? My ...
Franck Freiburger's user avatar
23 votes
3 answers
4k views

Open certain files in a workspace as read-only in VS Code

I am working on a typescript project using Visual Studio Code. I have a workflow in which a gulp task will copy a code into a target folder. Copied file will be used by the respective files in the ...
rmchndrng's user avatar
  • 812
22 votes
2 answers
2k views

How do I do populate on mongoosastic?

My goal is to populate certain fields in mongoosastic search, but if I do the following codes, it will always return Here's the code var mongoose = require('mongoose'); var Category = require('./...
Jack Moscovi's user avatar
  • 2,205
19 votes
1 answer
2k views

PNPM linking with standalone NextJS build

I'm trying to create production Dockerfile using NextJS standalone mode and PNPM. In next.config.js i have output configuration: experimental: { outputStandalone: true, outputFileTracingRoot:...
Dooomel's user avatar
  • 566
19 votes
2 answers
625 views

How to start a new connection with CosmoDB graph database using gremlin on version ^3

I am trying to create a new gremlin client in node js, but I cannot find any documentation how to set up the connection with both a URL and a primary key (as generated in Azure CosmosDB). Examples ...
Michal Paszkiewicz's user avatar
19 votes
2 answers
2k views

Query based on included data in Sequelize

I have a table for people with a self-association so people can have parents/children/cousins/etc. const People = sequelize.define('People', { gender: Sequelize.STRING, name: Sequelize.STRING, ...
wazzaday's user avatar
  • 9,564
18 votes
1 answer
3k views

Two versions of icu4c installed by Homebrew

Whenever I attempted to run npm --version or node --version on my Mac, I was getting the following error: $> node --version dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib ...
stevendesu's user avatar
  • 16.1k
18 votes
1 answer
2k views

Cypress runs old code instead of running updated code changes

I'm running into an issue with Cypress.io that I don't see too much helpful information about out there. Essentially, whenever I make changes to my code (e.g. implement a new method, remove an old ...
erik-rt's user avatar
  • 181
18 votes
2 answers
5k views

How to get docker and npm workspaces to work fine without copying root master node_modules everywhere

I have a project structure like so: +-- node_modules +-- package-lock.json +-- package.json `-- workspace-a `-- package.json <---includes common as a dependency `-- common `-- package.json ...
reactor's user avatar
  • 1,802
17 votes
1 answer
5k views

How to enable http2 protocol in nuxt.js

How to enable http2 protocol in nuxt.js app? I have added SSL certificates and enabled modern mode, played with render>http2 settings in nuxt.config.js, but no matter what I try app still serves ...
Andrius Solopovas's user avatar
17 votes
1 answer
5k views

Google Page Speed Insights - Basic Authentication

I am current using npm psi to do psi tests against a site which is publicly accessible (except with basic authentication). All of my attempts to use the username:password@ convention have failed me ...
jshthornton's user avatar
  • 1,284
16 votes
1 answer
1k views

Graphql Yoga Playground with Lambda - "Server cannot be reached"

I'm in the process of setting a graphql endpoint with servlerless/ lambda and am receiving an error when trying to connect to the graphql playground that comes with graphql-yoga. When I go to my route ...
red house 87's user avatar
  • 2,055
16 votes
2 answers
2k views

Laravel Websockets receive messages from clients

I want to build a basic global (no rooms) chat with laravel / node / redis using websockets. I followed this tutorial: http://blog.nedex.io/laravel-5-1-broadcasting-events-using-redis-driver-socket-...
Frnak's user avatar
  • 6,691
16 votes
2 answers
6k views

Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:*.herokuapp.com, DNS:herokuapp.com

I have an api created and hosted on Heroku. I have my web app running on localhost. I am using NextJS for my app. I am able to access all my apis hosted on Heroku via my web app which is running on ...
BraveEvidence's user avatar
15 votes
0 answers
9k views

Disabling GPU Acceleration in Cypress

I'm running Cypress in a Docker container in Jenkins. This is my Dockerfile: #Base image taken from:https://github.com/cypress-io/cypress-docker-images FROM cypress/browsers:node14.17.0-chrome91-ff89 #...
Tommy VDFN's user avatar
15 votes
0 answers
2k views

How to set up Node.js server with cookie based KeyCloak authentication - getting infinite redirects now

I'm setting up a Node.js server that is protected by KeyCloak. This is the first time I'm using KeyCloak, I'm experimenting with various use-cases. I successfully implemented the scenario where I use ...
takacsmark's user avatar
  • 4,151
15 votes
1 answer
765 views

Chrome doesn't show file as being downloaded until 8 bytes are sent (Firefox does)

I want to have an http method that sends the file to the user, but it needs some time (e.g. 4 seconds) to generate file content. What I want, is the browser to instantly show the file as being ...
Shaddix's user avatar
  • 6,021
15 votes
2 answers
2k views

Cloud Functions of Firebase failed to emulate

When I try to run npm run serve: "build": "./node_modules/.bin/tsc", "serve": "npm run build && firebase serve --only functions", I get an output that says it failed to emulate my functions: ...
Eliya Cohen's user avatar
15 votes
0 answers
3k views

visual studio code - mongoose (custom) schema methods are not recognized after importing the model into another file

Expected functionality: autocomplete of object methods and recognition of method parameters Actual functionality: no autocomplete or method parameters recognized. hovering over the method displays any ...
vampiire's user avatar
  • 1,160
15 votes
1 answer
2k views

Pipe buffer image data into Uint8ClampedArray format in Node.js

I'm trying to pipe image data into a function that I have been successfully using in the browser. The code in the browser is as follows: var myImageData = context.getImageData(0, 0, width, height); ...
abagshaw's user avatar
  • 6,302
15 votes
1 answer
5k views

Node.js: child_process.spawn no output standard output unless 'inherit'

I'm trying to capture standard output from a spawned child_process in Node.js (0.10.29). Right now I'm just trying with ping. The following code doesn't print (but does ping) var exec = require('...
dbenny's user avatar
  • 151
15 votes
2 answers
4k views

What encoding is expected for Node.js source code?

I’ve done some Google searches, but I get results related to encoding strings or files. Can I write my Node.js JavaScript source code in UTF-8? Can I use non-ASCII characters in comments, strings, or ...
Nate's user avatar
  • 18.8k
15 votes
1 answer
5k views

Using --ignore-scripts for one dependency in NPM

Following this question, NPM dependencies can be installed using: $ npm install --ignore-scripts Is there a way to mark that a dependency should be installed without running scripts in package.json? ...
Kwoppy's user avatar
  • 299
14 votes
2 answers
881 views

How to have top level await in typescript (switch from commonjs to esnext) without having to change all imports to have .js ending

I would like to have top level await in my typescript nodejs project. My tsconfig used to look like this: { "compilerOptions": { "target": "es2017", "...
sev's user avatar
  • 1,642
14 votes
1 answer
10k views

Webpack-dev-server "Cannot GET /"

i'm trying to get my webpack-dev-server to run but i face always the error "Cannot Get /" at the browser. I know that there are serveral questions with the same error, but none of them ...
phpet's user avatar
  • 141
14 votes
0 answers
4k views

Best way to *override* third party TypeScript types in node_modules

In many cases third party type definitions shipped either via a dedicated @types/* package or alongside the npm package itself are later found to be incomplete or incompatible with a new dependency. I'...
Richard Scarrott's user avatar
14 votes
2 answers
8k views

Puppeteer - Error: Protocol error (Network.getResponseBody): No resource with given identifier found

I'm trying with this code to get the response body from a website using puppeteer. #!/usr/bin/env node require('dotenv').config(); const puppeteer = require('puppeteer'); const readline = require('...
newbiedev's user avatar
  • 2,883
14 votes
0 answers
5k views

How to debug NextJS during the build phase

My nextJS app have a path with 50k plus pages. Running with npm run dev it works fine, but during build it gives me an error TypeError: Cannot read property 'page' of undefined at exportPaths.filter....
Amantel's user avatar
  • 709
14 votes
1 answer
517 views

Can I create a federated user in firebase manually using admin authentication api?

I've a web application built using firebase. In my web app, I've google, firebase, twitter signup/signin functionalities. Now I want to integrate this with my api.ai agent and have a seamless ...
Phani's user avatar
  • 1,881
14 votes
3 answers
3k views

How to create temp table in node.js by use Sequelize and Postgres

I have a question about: "How to create temp table in node.js by used Sequelize and Postgres" I can not found anywhere how to do that without use query command, like findAll(), findOne() functions of ...
Nam Tran Thanh's user avatar
14 votes
3 answers
11k views

Sequelize Composite Foreign Key

I have a database with the following tables: CREATE TABLE IF NOT EXISTS `app_user` ( `user_id` INT NOT NULL, `user_name` VARCHAR(45) NOT NULL, PRIMARY KEY (`user_id`)) ENGINE = InnoDB; CREATE ...
Diego Vidal's user avatar
14 votes
1 answer
7k views

Cosmos DB Mongo API How to manage "Request Rate is Large" condition

I Have the following code.. async function bulkInsert(db, collectionName, documents) { try { const cosmosResults = await db.collection(collectionName).insertMany(documents); console.log(...
mark d drake's user avatar
  • 1,365
14 votes
1 answer
6k views

Writing a Socket.IO server in C++

I want to write a C++ server that uses the same wire format as Socket.IO. I found the gevent-socketio packet codec for the wire but I can't find the corresponding client codec. The packets get ...
Cuadue's user avatar
  • 3,839
13 votes
0 answers
951 views

Wav to Opus convertion with Discord.js/opus fails silently

I am trying to convert a WAV file to Opus, using Node's fs.readFile and passing that buffer to @Discord/opus converter. I get neither the result or a error thrown with a explanation of what is wrong. ...
Rikard's user avatar
  • 7,565
13 votes
0 answers
742 views

Node.js profiler - Everything in Shared Libraries?

I am currently doing Advent Of Code (definately to recommend btw but off topic. However on Day 3 I was pretty unhappy with the performance of my algorithm. So I started using the built in node ...
relief.melone's user avatar
13 votes
0 answers
15k views

RSA_padding_check_PKCS1_OAEP_mgf1:oaep decoding error

I'm trying to use iOS swift (client side) to encrypt some data before sending it to node.js server to decrypt it. However, while decrypting in node.js I'm hitting: Error: error:04099079:rsa routines:...
FSTL's user avatar
  • 151
13 votes
1 answer
1k views

VS Code Intellisense for auto exported global variables

Sails exports a set og global variables, such as: _ (lodash) sails (framework related) ModelOne, ModelTwo, ModelThree, ... (the sails models we define) Creating a jsconfig.json targeting es5 doesn't ...
Diogo Neves's user avatar
13 votes
1 answer
1k views

Disable Networking in Electron

electron.js is a user interface toolkit that allows a web application to operate as an arbitrary GUI. However, there are some applications that should be considered sensitive - for instance, a GUI ...
Athan Clark's user avatar
  • 3,896
13 votes
2 answers
2k views

Node.js Electron Applications for Single Core Windows 7 machines are slow on file I/O

I'm running an electron application on a single core windows 7 machine. It seems whenever I do almost any file I/O with the fs library, the CPU spikes to ~100% for the electron process and it can take ...
Aaron Harrington's user avatar
13 votes
0 answers
7k views

500.1013 error when using iisnode and express

I have an express app running in my machine. I am even able to run it in production by using node server instead of issnode. When trying to make it run in iisnode I'm getting the following error ...
Alvaro's user avatar
  • 41.1k
13 votes
0 answers
1k views

Webpack recompiles unchanged files, slowing build times

Relevant webpack/webpack issue. Using webpack in real projects slows down, in my experience, after you pile on a certain number of components and/or dependencies. I have a test repository that seeks ...
Theodor Vararu's user avatar
13 votes
1 answer
3k views

Can gulp-usemin accept multiple files?

I have an issue with usemin and am not sure if it is a bug. My application structure is simple: - root |- gulpfile.js |- app | |- index.html | |- about.html | |- contact....
Daniel Tate's user avatar
  • 2,115
13 votes
0 answers
4k views

How do I properly run the VJET development tools for NodeJS on Eclipse?

The default javascript editor for Eclipse has very poor outlining and code completion. As a result of this, for any modern javascript application like ExtJS or NodeJS where you need to write a lot of ...
Redsandro's user avatar
  • 11.2k
13 votes
2 answers
1k views

Nodejs child_process spawn get command ran

For clarify purposes I want to see the exact command Node.js runs versus the shell/cli. Unfortunately I can't seem to find out how... https://nodejs.org/api/child_process.html#...
2778's user avatar
  • 834
13 votes
2 answers
16k views

Iterating over TR in a table with Cheerio.js

I'm having issues using the selectors that are available for Cheerio.js that I use on my Node server. The core is supposedly based on jQuery, however I can't really make it work using the same ...
Marty's user avatar
  • 483
12 votes
1 answer
11k views

What is the difference between BullMQ and other message queue implementations?

I've been looking at the docs for BullMQ: https://github.com/taskforcesh/bullmq https://docs.bullmq.io/what-is-bullmq I noticed in its comparison chart that it doesn't contain projects like RabbitMQ ...
McFlurriez's user avatar

1
2 3 4 5
3640