如何在linux中安装node.tar.xz文件 [英] How to install node.tar.xz file in linux

查看:176
本文介绍了如何在linux中安装node.tar.xz文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近从官方网站下载了 Nodejs 文件,但我不知道如何从存档文件安装 Nodejs.

I recently downloaded the Nodejs file from the official site and I don't know how to install the Nodejs from a archived file.

请帮助我如何安装此文件以便我可以运行npm"来自 CLI 的命令,用于为我自己的项目安装多个包.

Please help me how can I install this file so that I can run the "npm" command from the CLI for installation of several packages for my own project.

推荐答案

在ubuntu中下载安装node的步骤

第 1 步:从 https://下载最新或推荐的 node .tar.xz 文件nodejs.org/en/

Step 1: Download latest or recommended node .tar.xz file from https://nodejs.org/en/

或者您可以直接从这里下载节点版本 14.15.5(.tar.xz 文件)->

or you can download node version 14.15.5 (.tar.xz file) directly from here ->

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

第 2 步:转到下载(.tar.xz 文件)的目录.

Step 2: Go to the directory in which (.tar.xz file) is downloaded.

就我而言-->/下载目录

In my case --> /Download directory

第 3 步:更新系统存储库

Step 3: Update System Repositories

sudo apt update

第 4 步:安装包 xz-utils

Step 4: Install the package xz-utils

sudo apt install xz-utils

步骤 5:提取 .tar.xz 文件

Step 5: To Extract the .tar.xz file

sudo tar -xvf name_of_file

就我而言-->sudo tar -xvf node-v14.15.5-linux-x64.tar.xz

第六步:sudo cp -r directory_name/{bin,include,lib,share}/usr/

就我而言-->sudo cp -r node-v14.15.5-linux-x64/{bin,include,lib,share}/usr/

第七步:检查节点版本

node --version

结果就我而言 ->v14.15.5

这篇关于如何在linux中安装node.tar.xz文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆