fnm.el configures Emacs to use Node.js installations managed by
Fast Node Manager (FNM). It updates PATH, exec-path, and
NODE_PATH without evaluating shell output.
Version resolution is delegated to fnm exec. FNM recursively resolves
.nvmrc, .node-version, and package.json#engines.node, then falls back to
its default alias.
- Emacs 28.1 or later
- A current
fnmrelease withexecand--resolve-engines, available onexec-path
The package has no third-party Emacs Lisp dependencies.
(use-package fnm
:straight (:host github :repo "bobrowadam/fnm.el"))The package is not currently available from MELPA.
M-x fnm-use asks FNM to resolve the current directory and falls back to its
default alias.
(fnm-use)Pass any selector accepted by FNM to select it explicitly:
(fnm-use "20")
(fnm-use "lts-latest")M-x fnm-use-version provides completion over installed semantic versions.
Enable the global minor mode to ask FNM to resolve Node when opening files in a different directory:
(fnm-auto-use-mode 1)Disable it with (fnm-auto-use-mode -1). Run M-x fnm-use after changing a
version file in the current directory.
Set fnm-executable when fnm is not discoverable on exec-path.
Run the ERT suite with:
emacs -Q --batch -L . -l fnm-test.el -f ert-run-tests-batch-and-exitContributions to fnm.el are welcome.