preface
In Windows development environment, it is common to hear people about git, nodeJS, Python and other environment installation problems.
The common practice is to go to the official website and download the latest stable version, or whatever release you need for your environment.
The same download method as the application brings inconvenience to the subsequent management, version change and upgrade, so it would be nice to think that the package can be managed as apt-get under Linux or BREW under MAC. Brew Install $package can be used to download the required packages.
So this article introduces the Windows equivalent of the package management chocolate – Choco.
Environment type
Before introducing Choco, we need to clarify the types of environments we use in our development environment, so that we can determine which environments are best managed by Choco. Those familiar with this chapter may skip it.
We classify the environment into the following two categories:
-
Applications with graphical interfaces
-
No graphics, is the silent environment required when the program is running
- No version switch, backward compatible environment
- An environment where version switching is required and there are significant differences between versions
-
Application with graphical interface: for example, vscode, JetBrains, etc., you can download the latest version from the official website and use it. When the version is updated, it will push itself.
-
No graphical, is needs in the program is running silent environment: such as git, nodejs, python, JDK, NPM, yarn, docker, etc.
Most of these environments are the kind that can be deployed and basically run for good. “Environment for a week, development for half an hour” before deployment.
To make matters worse, some of these packages have version incompatibinities. In Windows, some developers do not manage version switching, but use environment variables to control it. The problem is first dug and then patched up.
So a lot of the second type of packages, we can actually use Choco for unified management and upgrade.
introduce
Choco is a package management tool for Windows. Same as apt-get and Homebrew.
The installation
Choco Installation Tutorial (choco Installation Tutorial)
-
First of all, you need to make sure you’re using an administrator terminal.
-
Install using Powershell
$ Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) Copy the code
-
Copy the command line above
-
Once it’s installed
-
If no errors are reported, try choco or choco -?
use
-
Search for packages available for installation
e.g.
$ choco search python
-
The installation
-
git
$ choco install git Copy the code
-
python
$ choco install python Copy the code
-
node
$ choco install node Copy the code
-
jdk
$ choco install jdk8 Copy the code
-
Afterword.
Catch up on Node and Python versioning in your spare time
\