( ! ) Warning: Undefined variable $sapa in /www/wwwroot/news.descreated.com/wp-content/themes/wpberita/visit-bot.php on line 140
Call Stack
#TimeMemoryFunctionLocation
10.0003359488{main}( ).../index.php:0
20.0004359800require( '/www/wwwroot/news.descreated.com/wp-blog-header.php ).../index.php:17
31.853720891104require_once( '/www/wwwroot/news.descreated.com/wp-includes/template-loader.php ).../wp-blog-header.php:19
41.900020941752include( '/www/wwwroot/news.descreated.com/wp-content/themes/wpberita/single.php ).../template-loader.php:106
51.900020941752get_header( $name = ???, $args = ??? ).../single.php:15
61.900020942128locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
71.900620942416load_template( $_template_file = '/www/wwwroot/news.descreated.com/wp-content/themes/wpberita/header.php', $load_once = TRUE, $args = [] ).../template.php:725
81.900820951184require_once( '/www/wwwroot/news.descreated.com/wp-content/themes/wpberita/header.php ).../template.php:790
91.900920951824require( '/www/wwwroot/news.descreated.com/wp-content/themes/wpberita/visit-bot.php ).../header.php:1
Install Node.js and npm from NodeSource repository - Descreate News - Teknologi

Install Node.js and npm from NodeSource repository

  • Bagikan

Prerequisites

  • An RHEL-based system, such as CentOS 7
  • Access to a terminal/command line
  • The yum package manager, included by default
  • Access to the root user or a user with sudo privileges

Option 1: Install Node.js and npm from NodeSource repository

The simplest way to install Node.js and npm is from the NodeSource repository.

1. First, update the local repository to ensure you install the latest versions of Node.js and npm. Type in the following command:

sudo yum update

2. Next, add the NodeSource repository to the system with:

curl –sL https://rpm.nodesource.com/setup_10.x | sudo bash -

3. The output will prompt you to use the following command if you want to install Node.js and npm:

sudo yum install –y nodejs

4. Finally, verify the installed software with the commands:

node –version
check node version
npm –version
check npm version

As you can see in the images above, the system downloaded the latest stable versions – Node.js 10.16.0, and npm 6.9.0.

Option 2: Install Node.js and npm using NVM

Step 1: Install Node Version Manager (NVM)

Alternatively, you can install Node.js and npm with the Node Version Manager (NVM), a tool practical for managing multiple Node.js versions.

1. To install NVM, download the installation script from GitHub. You will use the command line curl.

If you do not have this prerequisite tool, install it by running:

sudo apt install curl

Press y to confirm the installation and hit Enter.

2. After installing curl, download the NVM installation script with the command:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

The command instructs the system to clone the NVM repository and add the NVM path to ZSH or bash. Once this is done, you will receive the following message:

command to instruct the system to clone the NVM repository and add the NVM path to ZSH or Bash

As the output suggests, to enable nvm you need to:

  • Close and open the terminal OR
  • Run the given command

3. Then, check whether the Node Version Manager installation was successful with the command:

nvm –version

The image below shows you have installed NVM 0.34.0, the latest stable version.

 check the Node Version Manager installation

Note: Check out the differences between NVM and NPM.

Step 2: Install Node.js and npm

1. Once you have installed NVM, download Node.js and npm with the command:

nvm install node

2. As always, make sure to check the version installed:

node –version
Install Node.js and npm and verify installation

Optional: Install multiple Node.js versions using NVM

NVM is a package manager. Therefore, it can install and manage multiple Node.js versions.

To install a specific version of Node, type in nvm install and the number of the version.

For example:

nvm install 10.1.0

or to install the latest stable version::

nvm install --lts

To view a list of the versions you have installed on your manager with:

nvm ls

This will list all installed Node.js versions, as well as specify the default and stable versions.

list all installed Node.js versions

To switch to another version of Node.js you have already installed, use the command:

nvm use 10.16.0

Install Node.js Development Tools

Development tools is an automation tool kit that allows compiling and installing native add-ons from the npm.

To install Node.js development tools and libraries, use the command:

sudo yum install gcc g++ make
  • Bagikan