Cài đặt node JS trên AWS EC2 năm 2022

13th Mar 2022
Table of contents

To set up Node.js on your Linux instance

Connect to your Linux instance as ec2-user using SSH.

Install node version manager (nvm) by typing the following at the command line.

AWS does not control the following code. Before you run it, be sure to verify its authenticity and integrity. More information about this code can be found in the nvm GitHub repository.

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

We will use nvm to install Node.js because nvm can install multiple versions of Node.js and allow you to switch between them.

Activate nvm by typing the following at the command line.

. ~/.nvm/nvm.sh

Use nvm to install the latest version of Node.js by typing the following at the command line.

nvm install node

Installing Node.js also installs the Node Package Manager (npm) so you can install additional modules as needed.

Test that Node.js is installed and running correctly by typing the following at the command line.

node -e "console.log('Running Node.js ' + process.version)"

This displays the following message that shows the version of Node.js that is running.

Running Node.js VERSION

Bạn thấy bài viết này như thế nào?
0 reactions

Add new comment

Image CAPTCHA
Enter the characters shown in the image.
Câu nói tâm đắc: “Điều tuyệt với nhất trong cuộc sống là làm được những việc mà người khác tin là không thể!”

Related Articles

Thanks for the great feedback and suggestions, this version is a collab between me and all of you who commented under the previous post.

Công việc của người làm Data Engineer là xây dựng các hệ thu thập quản lý chuyển đổi dữ liệu thô thành thông tin có

It is the second article in the Learn AWS CLI series. It gives you an overview of working with the AWS S3 bucket using CLI commands. We also look at a brief overview of the S3 bucket and its key components.

Hướng dẫn đặt mật khẩu folder web trên apache cho các phần của trang web mà bạn muốn hạn chế quyền truy cập.