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
为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
的发行版,我们将使用yum
或dnf
命令(如下所示)在其中安装npm
软件包。
$ sudo yum install npm
OR
要么
$ sudo dnf install 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
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]
在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.
我们可以使用以下yum
或dnf
命令更新npm
软件包。
$ yum update npm
OR
要么
$ dnf update npm
翻译自: https://www.poftut.com/how-to-update-npm-on-linux-and-windows/
linux更新npm