乐闻世界logo
搜索文章和话题

How to install Watchman on Windows (win10)?

1个答案

1

Installing Watchman on Windows (Win10) is straightforward, but there are a few key points to note. Below are the detailed steps and recommendations:

Step 1: Install Chocolatey

Watchman can be installed via Chocolatey, a Windows package manager. First, ensure Chocolatey is already installed on your system. If not, follow these steps:

  1. Open a Command Prompt with administrator privileges (right-click the Start button and select 'Command Prompt (Admin)').
  2. Execute the following command to install Chocolatey:
shell
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

This command downloads and runs the Chocolatey installation script.

Step 2: Install Watchman using Chocolatey

Once Chocolatey is installed, proceed to install Watchman. Execute the following command in an administrator Command Prompt:

shell
choco install watchman

This command automatically locates the latest version of Watchman from the Chocolatey repository and installs it.

Step 3: Verify Installation

After installation, confirm Watchman is correctly installed and accessible. Execute the following command in the Command Prompt:

shell
watchman --version

If successful, this command displays the Watchman version.

Additional Notes

  • Administrator privileges: Administrator privileges are required during installation to ensure proper system-wide installation.
  • Network connection: A stable internet connection is necessary, as Chocolatey downloads Watchman from the internet.

Example

In my previous project, we used Watchman to monitor file changes and automatically trigger test and build tasks. After installing Watchman, we created a simple watchman script to monitor project file modifications, significantly enhancing development efficiency and code quality. For instance, whenever a file is modified, Watchman automatically initiates our automated test suite to ensure no existing functionality is broken.

2024年7月25日 19:10 回复

你的答案