Explore all blogs

Can't set headers after they are sent to the client

Can't set headers after they are sent to the client

Error “Can't set headers after they are sent to the client” occurs when an express.js application tries to send multiple responses for a single request.

Cannot read property of undefined in JavaScript

Cannot read property of undefined in JavaScript

The TypeError: Cannot read property of undefined occurs when we try to read a property on an undefined variable or when we try to access a property on a DOM element that doesn't exist.

ERESOLVE unable to resolve dependency tree error when installing npm packages

ERESOLVE unable to resolve dependency tree error when installing npm packages

To solve ERESOLVE unable to resolve dependency tree error when installing npm packages, ignore the peerDependencies by --legacy-peer-deps flag, downgrade the npm version.

event loop and callback queue

Event Loop and Callback Queue in JavaScript

The event loop keeps monitoring the call stack and callback queue for executing callback functions. Read more about web APIs, callback queue, microtask queue, event loops, and starvation.

Factory Design Pattern in JavaScript

Factory Design Pattern in JavaScript

Factory allows you to handle all the object creation in a centralized location which helps the code clean, concise, and maintainable. Understand deeply with examples.

Greatest Common Divisor (GCD) in JavaScript

Find greatest common divisor (GCD) in JavaScript

Find the Greatest Common Divisor(GCD) of two numbers using the Euclidean algorithm in javascript. Calculate GCD for a given integer array.

How to Fix error:0308010C:digital envelope routines::unsupported

How to Fix error:0308010C:digital envelope routines::unsupported

To fix the error:0308010C:digital envelope routines::unsupported, enable the legacy provider for Node.js by passing --openssl-legacy-provider flag to webpack.

npm ERR! Missing script: "start"

How to fix npm ERR! Missing script: "start"

The npm ERR! missing script: start error occurs when the start script is not defined in package.json file. To solve this error, define the "start" script.

node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

To solve the error “node: --openssl-legacy-provider is not allowed in NODE_OPTIONS”, unset the value in the environment variable NODE_OPTIONS.

Remove an item from an array in JavaScript

Remove an item from an array in JavaScript

To remove an item from an array in javascript, use filter() method or indexOf() and splice() methods together to remove an item by value. Learn with examples.

pm2 cluster

Scaling Node.js Applications With PM2 Clusters

Learn cluster modules in node js, install and configure PM2 in production, and implement PM2 clusters using the PM2 ecosystem without any modification in the current application code.

Uncaught syntaxerror cannot use import statement outside a module

Uncaught syntaxerror cannot use import statement outside a module

To solve “Uncaught SyntaxError: Cannot use import statement outside a module” add type="module" to the script tag or add "type": “module” in the package.json file.