How to Fix Error: error:0308010c:digital envelope routines::unsupported

Error: error:0308010c:digital envelope routines::unsupported occurs when “you are not using the LTS (long-term support) version of Node.js or you are using react-script with a version of less than 5.” Understanding the error If you work with Node.js and command line interface solutions like Webpack, create-react-app, or vue-cli-service, you might have encountered the error, Error: error:0308010c:digital … Read more

How to Fix “the engine ‘node’ is incompatible with this module”

Error the engine node is incompatible with this module occurs when the “package you are trying to install is not compatible with your Node.js engine (version).” To fix the “the engine ‘node’ is incompatible with this module” error, add the –ignore-engines suffix while installing the package like this: yarn install –ignore-engines. yarn install –ignore-engines # OR yarn global … Read more

How to Fix opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ]

Error:03000086:digital envelope routines::initialization typically occurs when there is a “problem with initializing the digital envelope routines used in your Node.js application.” How to fix the error:03000086:digital envelope routines::initialization To fix the error:03000086:digital envelope routines::initialization, “uninstall Node.js version 17+ and reinstall Node.js version 16.” Here is the step-by-step guide to fix the error. Step 1: Install Node.js … Read more

How to Implement Algolia Search in Node.js

Algolia is a search engine API that allows developers to add search functionality to their applications. Algolia search can be implemented in Node.js by installing the algoliasearch package, a client library for communicating with the Algolia API. Here is the step-by-step guide on implementing the algolia search in Node.js. Step 1: Install the algolia package. mkdir … Read more

An Express HTTPS Server with a Self-signed Certificate

The self-signed certificate will be enough to establish a secure HTTPS connection, although browsers will complain that the certificate is self-signed and is not trusted. Nevertheless, it is still great for development purposes. You must have installed OpenSSL installed on your machine. If not, on a Mac, you can install it using Brew. Install OpenSSL if … Read more

How to Update Node Version on Mac in 2023

Here are four ways to update the node version on Mac. Using N: An npm-based node version manager. Using Homebrew: Type this command: brew upgrade node Using NVM: A script-based node version manager. Using MacPorts: MacPorts is the other package manager for Mac. Method 1: Update Node using N N is an npm-based node version … Read more

How to Setup Node Express and MongoDB in Docker

Here is the step-by-step guide to setting up node express and MongoDB in Docker. Step 1: Install the dependencies. Create a project folder in your leading directory by the following command. mkdir newdock Go into the folder. cd newdock Install the following dependencies. yarn add express mongodb or npm install express mongodb –save I am … Read more

Node Socket.io Tutorial: Real-time Chat Application

WebSocket is the internet protocol that allows for full-duplex communication between servers and clients. This protocol goes beyond the typical HTTP request/response paradigm; with WebSockets, the server may send data to a client without initiating a request, thus allowing for some exciting applications. Follow the step-by-step guide to create an application with Node.js and Socket.io. … Read more

How to Set up a Node.js Express Server for React

Here is the step-by-step guide for creating an application that uses React, Node.js, and express server. Step 1: Install React using create react app. npx create-react-app react-express-tutorial After installing, go into that directory. cd react-express-tutorial Start the development server. yarn start Step 2: Define the routing of components. Type the following command in your terminal … Read more

Express.js express.Router() Function

Express.Router() function is “used to create a new router object.” The Router() function is used when you want to create a new router object in your program to handle requests. Syntax express.Router( [options] ) Optional Parameters case-sensitive: This enables case sensitivity. mergeParams: It preserves the req.params values from the parent router. strict: This enables strict … Read more

process.env: How to Use Environment Variables in Node

The process.env is “used to get the user environment.” Syntax process.env Return value This property returns an object containing the user environment. Basics of process.env Accessing environment variables in Node.js is supported out of the box. When your Node.js process boots up, it will automatically provide access to all the existing environment variables by creating … Read more

Session Management in Node.js using ExpressJS

When the client makes a login request to the server, the server will create a session and store it on the server side. When the server responds to the client, it sends a cookie. This cookie will contain the session’s unique id stored on the server, which will now be stored on the client. This … Read more

Form Data Validation in Node.js with express-validator

To create a form validation in express, use the “express-validator” package. We will create a form and send the POST request to the server, and then if the request fails against the validation, it will respond with an error message. Here is the step-by-step guide to form data validation in Node.js with express-validator. Step 1: … Read more

How to Create A Basic HTTP Web Server with Node.js

Follow the step-by-step guide to create a basic HTTP Web Server with Node.js. Step 1: Create a project folder. First, create a folder using the following command. mkdir node-server-tutorial Okay, now go into that folder and open it in your editor; in my case, it is code. Inside the root folder, make one file called server.js. … Read more

How to Send a POST Request from Node.js Express

To send a post request in the Node.js express framework, use the “express.Router().route().post()” method. The data sent through the POST request is stored in the request object. We use the Express POST method to save the data into the database. So underneath, what happens is that when the user sends a POST request to the server, … Read more

How to Send an Email in Node.js

To send an email in Node.js, use the “nodemailer” module. The nodemailer is a module that allows you to send emails easily without hassle. It uses a Simple Mail Transfer Protocol (SMTP) for sending email messages between servers. Most email systems that send mail over the Internet support SMTP-based sending. Here is the step-by-step guide … Read more

Node Express Image Upload and Resize Guide

To upload and resize an image to the node express server, use the “sharp library”. We will build Web APIs through an express web framework very quickly, and it has tremendous support for the NoSQL databases like MongoDB. Follow these steps to upload and resize the image. Step 1: Create Node Express Project Create a … Read more

Google reCAPTCHA Node.js: Step-By-Step Guide

There are two versions of reCAPTCHA offered by Google: reCAPTCHA v3 reCAPTCHA v2 We will use reCAPTCHA v2. Here is the step-by-step guide for Google recaptcha in Node.js. Step 1: Create a project and configure it. npm init We are initializing the package.json file. { “name”: “googlerecaptcha”, “version”: “1.0.0”, “description”: “”, “main”: “index.js”, “scripts”: { “start”: “nodemon … Read more