🚀 Fast and simple Node.js version manager, built in native ReasonML
✨ Single file, easy installation, instant startup
🚀 Built with speed in mind
🤔 Works with .nvmrc
and .node-version
files
For bash
, zsh
and fish
shells, there's an automatic installation script:
curl https://raw.githubusercontent.com/Schniz/fnm/master/.ci/install.sh | bash
--install-dir
Set a custom directory for fnm to be installed. The default is $HOME/.fnm
.
--skip-shell
Skip appending shell specific loader to shell config file, based on the current user shell, defined in $SHELL
. e.g. for Bash, $HOME/.bashrc
. $HOME/.zshrc
for Zsh. For Fish - $HOME/.config/fish/config.fish
Example:
curl https://raw.githubusercontent.com/Schniz/fnm/master/.ci/install.sh | bash -s -- --install-dir "./.fnm" --skip-shell
-
Download the latest release binary for your system
-
Make it available globally on
$PATH
-
Add the following line to your
.bashrc
/.zshrc
file:eval "`fnm env --multi`"
If you are using fish shell, add this line to your
config.fish
file:fnm env --multi | source
You can always use fnm --help
to read the docs:
Installs [VERSION]
. If no version provided, it will install the version specified in the .nvmrc
file located in the current working directory.
Activates [VERSION]
as the current Node version. If no version provided, it will activate the version specified in the .nvmrc
or .node-version
file located in the current working directory.
Lists the installed Node versions.
Lists the Node versions available to download remotely.
Prints the required shell commands in order to configure your shell, Bash compliant by default.
- Providing
--multi
will output the multishell support, allowing a different current Node version per shell - Providing
--shell=fish
will output the Fish-compliant version. Omitting it andfnm
will try to infer the current shell based on the process tree - Providing
--node-dist-mirror="https://npm.taobao.org/dist"
will use the Chinese mirror of Node.js - Providing
--use-on-cd
will also output a script that will automatically change the node version if a.nvmrc
/.node-version
file is found - Providing
--base-dir="/tmp/fnm"
will install and use versions in/tmp/fnm
directory
- Feature:
fnm use --install
- Feature:
fnm install lts
? - OSX: Add to homebrew?
- Windows Support?
- Linux: Replace
tar
with a statically linked library too (for ungzip + untar)
PRs welcome 🎉
npm install -g esy
git clone https://github.com/Schniz/fnm.git
cd fnm/
esy install
esy bootstrap
esy build
After building the project, you can run the main binary that is produced.
esy x fnm.exe
# Runs some smoke-unity test
esy test
# Runs the feature tests
feature_tests/run.sh