linux更新npm_如何在Linux和Windows上更新Npm?

linux更新npm

linux更新npm

NodeJS is a popular application development and deployment framework written in Javascript programming language. It provides server-side libraries and functionalities to accomplish tasks. Npm is the NodeJs Package Manager which is used to install, update, delete packages to the current application. In this tutorial, we will learn how to update npm in different operating systems like Ubuntu, Debian, Mint, Kali, CentOS, RedHat, Fedora, Windows, Windows Server etc.

NodeJS是使用Java编程语言编写的流行的应用程序开发和部署框架。 它提供服务器端库和功能来完成任务。 Npm是NodeJs软件包管理器,用于安装,更新,删除当前应用程序的软件包。 在本教程中,我们将学习如何在不同的操作系统(如Ubuntu,Debian,Mint,Kali,CentOS,RedHat,Fedora,Windows,Windows Server等)中更新npm。

为Ubuntu,Debian,Mint,Kali安装Npm软件包 (Install Npm Package For Ubuntu, Debian, Mint, Kali)

We can install npm package with the apt command where Ubuntu, Debian, Mint, Kali distributions support.

我们可以使用apt命令安装npm软件包,其中支持Ubuntu,Debian,Mint,Kali发行版。

$ sudo apt install npm
Install Npm Package For Ubuntu, Debian, Mint, Kali
Install Npm Package For Ubuntu, Debian, Mint, Kali
为Ubuntu,Debian,Mint,Kali安装Npm软件包

为Fedora,CentOS,RedHat安装Npm软件包(Install Npm Package For Fedora, CentOS, RedHat)

For yum based distributions we will use yum or dnf command like below where we will install npm package.

对于基于yum的发行版,我们将使用yumdnf命令(如下所示)在其中安装npm软件包。

$ sudo yum install npm

OR

要么

$ sudo dnf install npm
Install Npm Package For Fedora, CentOS, RedHat
Install Npm Package For Fedora, CentOS, RedHat
为Fedora,CentOS,RedHat安装Npm软件包

打印Npm版本(Print Npm Version)

Before updating the npm we will print the current npm version. We will use -v option which will print major and minor version information about npm.

在更新npm之前,我们将打印当前的npm版本。 我们将使用-v选项,该选项将打印有关npm的主要和次要版本信息。

$ npm -v
Print Npm Version
Print Npm Version
打印Npm版本

We can see that the current major version of the installed npm is 5 and the minor version is 8 .

我们可以看到,已安装的npm的当前主版本为5 ,次版本为8

在Windows,Linux(Ubuntu,Debian,Mint,CentOS,RedHat,Fedora)上更新 (Update On Windows, Linux (Ubuntu,Debian,Mint,CentOS,RedHat,Fedora))

After installing the npm package or executable we can use npm command to update npm. We will use install option with the -g option and [email protected] like below.

安装npm软件包或可执行文件后,我们可以使用npm命令更新npm。 我们将使用带有-g选项的install选项和如下所示的[email protected]

$ npm install -g [email protected]
Update On Windows, Linux (Ubuntu,Debian,Mint,CentOS,RedHat,Fedora)
Update On Windows, Linux (Ubuntu,Debian,Mint,CentOS,RedHat,Fedora)
在Windows,Linux(Ubuntu,Debian,Mint,CentOS,RedHat,Fedora)上更新

在Ubuntu,Debian,Mint,Kali上使用Package Manager更新(Update On Ubuntu, Debian, Mint, Kali with Package Manager)

deb based distributions like Ubuntu, Debian, Mint, Kali provides apt tool in order to update installed packages. We can use update option with the npm package like below.

基于deb的发行版(如Ubuntu,Debian,Mint,Kali)提供了apt工具来更新已安装的软件包。 我们可以对npm包使用update选项,如下所示。

$ sudo apt update npm

使用Package Manager在Fedora,CentOS,RedHat上更新 (Update On Fedora, CentOS, RedHat with Package Manager)

We can update npm package with the following yum or dnf commands.

我们可以使用以下yumdnf命令更新npm软件包。

$ yum update npm

OR

要么

$ dnf update npm
LEARN MORE  How To Install Gulp with Npm
了解更多如何使用Npm安装Gulp

翻译自: https://www.poftut.com/how-to-update-npm-on-linux-and-windows/

linux更新npm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值