Winget is the Windows Package Manager. If you’ve ever used Linux, you are more than likely to be familiar with Package Managers such as APT (Avanced Package Tool), or RPM (Red-Hat Package Manager), etc. These tools allow you to manage your software packages. This includes searching for available packages, installing packages, upgrading packages as well as all the dependences that go along with that package. Windows has lacked such a tool that can be used via the command line, until recently.
Winget comes pre-installed with Windows 11, if not, you can download the latest version as well as read the usage instructions here:
Microsoft Winget – Windows Package Manager
What is Winget?
The Windows Package Manager (also known as winget) is a free and open-source package manager designed by Microsoft for Windows 10 and Windows 11. It consists of a command-line utility and a set of services for installing applications — https://en.wikipedia.org
You can see what version of winget
you have, by running the following:
>winget --version v1.10.390
Winget Information
list
parameter. This displays the installed packages Names (for example “Steam”), the ID (Valve.Steam), version that is installed (2.10.91.91), and the Available Version (if there is an update available). This is an excellent view to see all the installed applications and whether or not they have a newer version. In which case, if they do, you can update it using winget upgrade.Since we already know that we are looking for NPM (Node Package Manager) or Node, we can search the winget repository by using the following syntax:
>winget search npm
Here are the results:
From the list above, you can see that the package we want to install is called named Node.js
and its Id is OpenJS.NodeJS.LTS
. Winget also provides us with the latest version number, as well as match and source metadata. To install an application or package, we use winget install [PackageID]
. Therefore to install NodeJS/NPM we simply type:
>winget install OpenJS.NodeJS.LTS
The LTS stands for Long Term Support version. You can also install using id OpenJS.NodeJS
, depending on which version you need. This will install NodeJS and all the dependencies:
If you prefer to use pnpm instead of npm, or both package managers, you can install both NPM/Node and PNPM, as well as GIT using the following command:
>winget install OpenJS.NodeJS.LTS pnpm.pnpm git.git
As you can tell, I also added the Id for GIT to our winget command above. You can install multiple packages/applications at once using winget. This makes installing NodeJS, NPM (or PNPM), and GIT a breeze as well as any of the other packages available. You can also check the latest version of a package, and upgrade the package inside the command line.
Once the install is complete, it will bring you back to the powershell command line. From here, you can check which version of the packages you have installed:
Winget Information
Summary
As stated, managing packages (or applications) is really easy with the command line. It really beats having to download and install each package from the website and then installing. With just a single command we have 3 applications downloaded and installed. If you are doing a new Windows install, this can be a very useful tool. With this and a little bit of powershell, you can have all your applications downloaded and installed for you.
0 Comments