nodejs download and install Linux
May 13, 2023 pm 04:30 PMNode.js is a JavaScript runtime based on the Chrome V8 engine, which allows the JavaScript runtime environment to be extended to the server side. It effectively solves the problem of inconsistency between front-end and back-end languages, allowing front-end developers to use JavaScript for full-stack development.
This article will introduce how to download and install Node.js on a Linux system.
Step 1: Install Node.js
In order to install Node.js on Linux, you first need to download it from the Node.js official website [https://nodejs.org](https:// nodejs.org/) to download the latest version of Node.js installation files.
Enter the download directory through the terminal and decompress the download file:
cd ~/Downloads tar -xvf node-v14.15.3-linux-x64.tar.xz
The above command assumes that you are already in the download directory and have downloaded the installation file of Node.js version 14.15.3. Please make corresponding modifications according to the version number of the file you downloaded.
After decompression is completed, move the Node.js directory to the /usr/local/ directory:
sudo mv node-v14.15.3-linux-x64 /usr/local/
Next, set the Node.js environment variable through the following command:
export PATH=$PATH:/usr/local/node-v14.15.3-linux-x64/bin
In order to permanently save the environment variables, you need to add the above command to the end of the ~/.bashrc file:
sudo nano ~/.bashrc
Add the following content in the .bashrc file:
export PATH=$PATH:/usr/local/node-v14.15.3-linux-x64/bin
After the addition is completed, save and Exit the .bashrc file and reload the environment variables via the following command:
source ~/.bashrc
Now Node.js has been successfully installed and can be verified via the node command:
node -v
The above command will output on that system Version information for Node.js.
Step 2: Install the Node.js package manager - npm
The Node.js package manager npm allows users to easily download and manage Node.js modules. After installing Node.js, npm is installed by default.
The following command can check the version information of npm:
npm -v
If the version information is output, it means that npm has been successfully installed.
Conclusion
Installing Node.js on a Linux system is very easy. First download the latest version of the binary file from the Node.js official website, then unzip it to the appropriate directory and add it to the system's PATH. Next, you can use the node and npm commands in the terminal to operate and manage the Node.js environment.
The above is the detailed content of nodejs download and install Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How does the React reconciliation algorithm work?

What is useEffect? How do you use it to perform side effects?

How does currying work in JavaScript, and what are its benefits?

What are higher-order functions in JavaScript, and how can they be used to write more concise and reusable code?

Explain the purpose of each lifecycle method and its use case.

What are React's performance optimization techniques (memoization, code splitting, lazy loading)?

What is useContext? How do you use it to share state between components?
