Installation

This document gives you detailed instructions and information about installing Flycheck.

Prerequisites

Flycheck needs GNU Emacs 26.1+ and works best on Unix-like systems like Linux or macOS. It does not support older releases of GNU Emacs or other flavours of Emacs (e.g. XEmacs, Aquamacs, etc.).

Windows support

Flycheck does not explicitly support Windows, but tries to maintain Windows compatibility and should generally work fine on Windows, too. However, we can neither answer questions about Windows nor fix bugs that only occur on Windows without the help of active Windows users. Please watch out for known Windows issues.

Syntax checking tools

Flycheck does not check buffers itself but relies on external programs to check buffers. These programs must be installed separately. Please take a look at the list of supported languages to find out what tools are required for a particular language.

Many of these programs are available in the package repositories of Linux distributions or in Homebrew for macOS. Others can be installed with standard package managers such as Rubygems, NPM, Cabal, etc.

Important

For a GUI Emacs on MacOS we recommend to install and configure exec-path-from-shell to make Emacs use the proper $PATH and avoid a common setup issue on MacOS.

Package installation

We recommend to install Flycheck with Emacs’ built-in package manager. Flycheck is available in the popular MELPA archive which serves up to date snapshots of Flycheck’s development state. We recommend to read through the changelog before every upgrade to check for any breaking changes that might affect you.

Note

The sibling repository MELPA Stable provides packages for Flycheck releases. If you prefer to follow the most recent changes use MELPA instead, but be aware that, while we try to be careful about the stability of the development snapshots, we may make breaking changes anytime without prior announcement.

Unfortunately the MELPA repositories are not available in Emacs by default. You must explicitly add them to package-archives with the following code in your init file:

(require 'package)

(add-to-list 'package-archives
             '("MELPA Stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)

This adds MELPA Stable; for MELPA replace https://stable.melpa.org with https://melpa.org and change the name accordingly. If you do not know where your init file is inspect the value of user-init-file with C-h v user-init-file.

Once the repository is set up you can install Flycheck from Emacs’ package menu at M-x list-packages, or directly with M-x package-install RET flycheck.

use-package

You may want to take a look at use-package which provides simple syntax to declare and configure packages in your init file. Specifically it allows to automatically install missing packages from package archive when Emacs starts.

Add the following form to your init file to setup Flycheck with use-package:

(use-package flycheck
  :ensure t
  :init (global-flycheck-mode))

Then press C-M-x with point somewhere in this form to install and enable Flycheck for the current Emacs session.

Distribution packages

Alternatively some distributions provide binary packages of Flycheck. We officially support the following distributions:

  • Debian 9 and newer: apt-get install elpa-flycheck flycheck-doc (the latter for our manual). The Debian Emacs addon team provides these packages.

Legacy installation methods

Some users prefer to install Flycheck with legacy methods such as el-get, Git submodules, etc that were common before Emacs included a package manager. There are also many 3rd party packages provided by various package managers. We do neither support nor endorse any of these:

Warning

If you install Flycheck in any way other than our official packages you do so at your own risk.

Please beware of breakage, and understand that while we do not actively work against alternative installation methods we will not make compromises to support alternative installation methods. We will close issues reported for alternative installation if we fail to reproduce them with a proper installation of Flycheck.