search
HomeWeb Front-endFront-end Q&AManually install nodejs on linux

Manually install nodejs on linux

May 27, 2023 pm 05:02 PM

Linux manual installation of Node.js

Node.js is a JavaScript running environment based on the Chrome V8 engine. It enables server-side development by allowing JavaScript code to run on the server side. This article explains how to manually install Node.js on Linux.

Preparation before installation

Before installing Node.js, you need to ensure that build-essential and libssl-dev have been installed on the system. You can install it through the following command:

sudo apt-get update
sudo apt-get install build-essential libssl-dev

Download Node.js

Open the Node.js official website https://nodejs.org/zh-cn/download/ and select the appropriate version to download. . Here we choose the latest stable version v14.15.5:

wget https://nodejs.org/dist/v14.15.5/node-v14.15.5-linux-x64.tar.xz

Decompress Node.js

After the download is complete, use the following command to decompress the file:

tar -xvf node-v14.15.5-linux-x64.tar.xz

After decompression, we You will get a directory named node-v14.15.5-linux-x64. Rename it to nodejs and move it to the /usr/local/ directory. This can be done using the following command:

sudo mv node-v14.15.5-linux-x64 /usr/local/nodejs

Configure environment variables

In order to facilitate the use of Node.js, It needs to be added to the system environment variables. We can do this by editing the /etc/profile file:

sudo nano /etc/profile

Add the following content at the end of the file:

# Node.js
export NODE_HOME=/usr/local/nodejs
export PATH=$NODE_HOME/bin:$PATH

Save and exit the file, and then execute the following command to make the changes take effect:

source /etc/profile

Complete installation

Enter the following command to check whether Node.js is successfully installed:

node -v

If the version number of node is output, Node.js has been successfully installed. At this time you can try running some simple JavaScript programs.

If you want to uninstall Node.js, just delete the /usr/local/nodejs directory and the environment variables added before.

Summary

Manually installing Node.js is not complicated. It only requires simple downloading, decompression, and configuration of environment variables. After the installation is complete, you can easily use Node.js for server-side development.

The above is the detailed content of Manually install nodejs on linux. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What type of audio files can be played using HTML5?What type of audio files can be played using HTML5?Apr 30, 2025 pm 02:59 PM

The article discusses HTML5 audio formats and cross-browser compatibility. It covers MP3, WAV, OGG, AAC, and WebM, and suggests using multiple sources and fallbacks for broader accessibility.

Difference between SVG and Canvas HTML5 element?Difference between SVG and Canvas HTML5 element?Apr 30, 2025 pm 02:58 PM

SVG and Canvas are HTML5 elements for web graphics. SVG, being vector-based, excels in scalability and interactivity, while Canvas, pixel-based, is better for performance-intensive applications like games.

Is drag and drop possible using HTML5 and how?Is drag and drop possible using HTML5 and how?Apr 30, 2025 pm 02:57 PM

HTML5 enables drag and drop with specific events and attributes, allowing customization but facing browser compatibility issues on older versions and mobile devices.

What is the difference between <meter> tag and <progress> tag?What is the difference between <meter> tag and <progress> tag?Apr 30, 2025 pm 02:56 PM

The article discusses the differences between HTML's <meter> and <progress> tags, used for displaying scalar values and task progress, respectively.

Convert the below data into Tabular format in HTML5?Convert the below data into Tabular format in HTML5?Apr 30, 2025 pm 02:54 PM

Here is the converted data into a tabular format using HTML5, including examples and strategies for responsive design, best practices for styling, and semantic HTML5 tags used within a table structure:<!DOCTYPE html> <html lang=&

Define Image Map?Define Image Map?Apr 30, 2025 pm 02:53 PM

The article discusses image maps in web design, their benefits like enhanced navigation and engagement, and tools for their creation.

Is the <datalist> tag and <select> tag same?Is the <datalist> tag and <select> tag same?Apr 30, 2025 pm 02:52 PM

The article discusses the differences between <datalist> and <select> tags, focusing on their functionality, user interaction, and suitability for different web development scenarios.

What is the difference between <figure> tag and <img> tag?What is the difference between <figure> tag and <img> tag?Apr 30, 2025 pm 02:50 PM

The article discusses the differences between HTML's <figure> and <img> tags, focusing on their purposes, usage, and semantic benefits. The main argument is that <figure> provides better structure and accessi

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.