Explore information related to node js


Error: EACCES: permission denied with npm - Best Fixes ?


This article covers methods to resolve "Error: EACCES: permission denied with npm" for our customers. If you see an EACCES error when you try to install a package globally, you can either:

  • Reinstall npm with a node version manager (recommended).
  • Manually change npm's default directory.


To download the latest version of npm, on the command line, run the following command:

$ npm install -g npm

Read More



Install CloudPanel on Ubuntu 20.04 - Step by Step Process ?


This article covers the Installation procedure of CloudPanel on Ubuntu 20.04. Basically, CloudPanel, an open source, PHP-based host control software built for the cloud helps to manage hosted services.

CloudPanel is a server management control panel designed to be fast, easy to use and customizable. This piece of software supports management of Domains, Linux services, Cron jobs, FTP services, System security through IP and Bots blocking, User management, Cloud platforms support, among many others.


Main features of CloudPanel Includes:

1. Free to use and open source

2. Provides powerful intuitive interface for management

3. Designed for high Performance with minimal resource usage

4. It is secure – provision of free SSL/TLS certificates

5. It supports all major clouds – AWS, Digital Ocean, GCP, e.t.c

6. CloudPanel is available in more than ten languages, making it easy to install in any region

7. One-Click Let's Encrypt Certificates

8. NGINX Support

9. Multiple PHP Versions


To fix failed CloudPanel installation:

$ sudo apt -f install

Read More



Install Bcrypt in Docker and resolve related errors


This article covers how to install Bcrypt in Docker and fix relating Docker errors.

To fix bcrypt error on Docker:

The error looks like this,

internal/modules/cjs/loader.js:807
app_1 | return process.dlopen(module, path.toNamespacedPath(filename));

To resolve, simply Add the following lines of code to the start.sh file,

#!/usr/bin/env bash

# install new dependencies if any
npm install
# uninstall the current bcrypt modules
npm uninstall bcrypt
# install the bcrypt modules for the machine
npm install bcrypt
echo "Starting API server"
npm start

Here,

i. npm uninstall bcrypt would remove bcrypt modules for the other operating system.
ii. npm install bcrypt would install for the current machine that the app would be running on.

Read More



HTTP Client in Node js


This article covers how to create HTTP Client in Node.js. Here, we performed GET, POST, PUT, and DELETE requests in Node.js. Node HTTP tutorial shows how to create HTTP server and client applications in JavaScript with HTTP module.
HTTP is a Node.js module which can be used to create HTTP server and client applications in JavaScript.
Node.js comes bundled with an http and an https module. These modules have functions to create an HTTP server so that a Node.js program can respond to HTTP requests. They can also make HTTP requests to other servers.
Popular JavaScript frameworks including Express and HapiJS are built on top of the HTTP module.

To Set up HTTP:
1. First, we install the HTTP module.
$ node -v
$ npm init -y
2. We initiate a new Node.js application.
$ npm i http
3. We install HTTP with npm i http command.

Read More



Node js Application with Docker on Ubuntu


This article will guide you on how to build a Node.js Application with Docker on Ubuntu. npm install downloads a package and it's dependencies. #npm install can be run with or without arguments. When run without arguments, npm install downloads dependencies defined in a package. json file and generates a node_modules folder with the installed modules.

The #docker build command builds Docker images from a Dockerfile and a “context”. 

A build's context is the set of files located in the specified PATH or URL . The build process can refer to any of the files in the context. 

With Dockerfile written, you can build the image using the following command: $ docker build .

Containerizing an #application is the process of making it able to run and deploy under Docker containers and similar technologies that encapsulate an application with its operating system environment (a full system image).

Some Docker #commands:

1. docker run – Runs a command in a new container.

2. docker start – Starts one or more stopped containers.

3. docker stop – Stops one or more running containers.

4. docker build – Builds an image form a Docker file.

5. docker pull – Pulls an image or a repository from a #registry.

Read More



More about Engintron cPanel


This article will guide you on how to #install #Engintron in #cPanel & fix relating #errors.  Engintron is a third-party plugin to integrate Nginx on cPanel servers. 

Engintron integrates Nginx into cPanel so you can enjoy amazing performance for your sites, without having to sacrifice important hosting features found in cPanel.

Engintron is totally free to use!

The way Engintron sets up Nginx inside your cPanel is a lot like how the popular #CloudFlare CDN works. Nginx (like CloudFlare) directly serves all static content like CSS, JS, images etc. instead of your actual web server, thus lowering the load on your cPanel server.


Engintron is the easiest way to integrate Nginx to your cPanel server:

1. Installation process is not very complicated for Engintron. 

2. Also, installation and updates are very fast, they take only a few seconds. 

3. Engintron is using the official repositories for Nginx, all Engintron software is updated whenever cPanel is updated. If something has changed on Engintron and you need to re-install it, you can install it on top of the previous installation. You don't need to uninstall it first like other Nginx installer plugins for cPanel. It works from CentOS 5 up to CentOS 7. Engintron has an app dashboard inside WHM. 

4. The interface has basic controls for Nginx, Apache, MySQL. These controls allow you to edit various configuration files. Inside the Engintron app dashboard you’ll also find some utilities to monitor things like Nginx access & error logs, check processes on your server or see incoming traffic on port 80. It doesn’t require Nginx or Apache host synchronization when adding new domains via cPanel. 

5. Also, Engintron is released under the GNU/GPL license and is 100% open source.

Read More



Deploy Node js Application to DigitalOcean Server


This article will guide you on how to  deploy node.js application to #DigitalOcean Server.  

To Deploying #Node . js application to DigitalOcean — Setting up the #server:

1. Getting familiar with Digital Ocean and creating your first #droplet.

2. Setting up #SSH and connecting to your server from your local #machine.

3. Setting up a simple Express.js web-server in local machine.

4. Using #Git to deploy your code to server.

Read More



Managing files with fs Module in Node js


This article will guide you on various functions that can be performed with fs #Module in Node.js such as reading, writing, and deleting files.

#Node . js includes fs module to access physical file system. The #fs module is responsible for all the asynchronous or synchronous file I/O operations.

To use FS in node JS:

The Node. js file system #module allows you to work with the file system on your #computer. To include the File System module, use the require() method: var fs = require('fs'):

1. Read files.

2. Create files.

3. Update files.

4. Delete files.

5. Rename files.

Read More



Restart Node js Apps Automatically with Nodemon


This article will guide you on how to restart node.js apps automatically with #nodemon.  If it's just running (not a #daemon) then just use Ctrl-C . Where PID is replaced by the number in the output of ps . nodemon will watch the files in the directory that nodemon was started, and if they change, it will automatically restart your node application.

To start Nodemon with #NPM:

1. #Install nodemon. Since nodemon is a command line tool, it has to be installed as a global node package. 

2. #Boot up the Node server. First, make sure that #MongoDB is already running in the background. 

3. Add nodemon to package.json as an #NPM script. 

4. Start the Node server via NPM.

Read More



Process to install node js Windows


This article will guide you on how to install Node.js and verify its installation. Additionally, you will also learn how to uninstall it. #Node . js is a runtime environment that allows software developers to launch both the #frontend and #backend of web apps using #JavaScript. Although JS underpins all the processes for app assembly, as a backend #development #environment, Node. js, differs from the frontend environment.

Read More



304 not modified error Steps to fix it


An #HTTP 304 not modified status #code means that the website you're requesting hasn't been updated since the last time you accessed it.

Basically, your browser will save (or cache) web #pages so it doesn't have to repeatedly download the same information. This is an attempt to speed up page delivery. However, if this happens to your site, #visitors could be prevented from accessing your #web pages.

Read More




For Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on LinuxAPT.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com






Focus on your business, not your servers.

Click Here to Learn More