-
Verify Installed Watchman Versions: Run
watchman --versionin the terminal to check the currently active Watchman version. To view all installed versions, locate the installation paths of Watchman using commands such aswhereis watchmanorwhich watchman. -
Determine Installation Paths for Each Watchman Version: After executing the above commands, you may see output like
/usr/local/bin/watchman. If multiple versions are installed, further investigate the specific paths for each version. -
Select and Uninstall a Specific Version: Once you identify the exact path for the Watchman version to uninstall, use the
rmcommand to delete the corresponding executable file. For example, if a version is installed at/usr/local/bin/watchman, run:
bashsudo rm /usr/local/bin/watchman
This removes the Watchman version at this specific path.
-
Update Environment Variables (if necessary): If your
PATHenvironment variable includes the path of the uninstalled Watchman, updatePATHto exclude it by editing your shell configuration file (e.g.,.bashrc,.zshrc, etc.). -
Verify Uninstallation: Reopen the terminal or use
sourceto refresh the configuration file, then runwatchman --versionagain to confirm the uninstalled version is no longer active. -
Note Dependency Issues: Before uninstalling a specific version, ensure no other software depends on it. Otherwise, uninstalling it may cause dependent applications to malfunction.
By following these steps, you can selectively uninstall one Watchman version while maintaining system stability. In practice, adjust these steps based on your operating system or installation method.