Alpine Build for " 🚀 Fast and simple Node.js version manager, built in Rust"
🌎 Alpine Linux support
✨ Single file, easy installation, instant startup
🚀 Built with speed in mind
📂 Works with .node-version
and .nvmrc
files
For bash
, zsh
and fish
shells, there's an automatic installation script.
First ensure that curl
and unzip
are already installed on you operating system. Then execute:
curl -fsSL https://vanaware.github.io/fnm-alpine/install.sh | sh
Upgrading fnm
is almost the same as installing it. To prevent duplication in your shell config file add --skip-shell
to install command.
--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/conf.d/fnm.fish
Example:
curl -fsSL https://vanaware.github.io/fnm-alpine/install.sh | sh -s -- --install-dir "./.fnm" --skip-shell
- Download the latest release binary
- Make it available globally on
PATH
environment variable - Set up your shell for fnm
To remove fnm (😢), just delete the .fnm
folder in your home directory. You should also edit your shell configuration to remove any references to fnm (ie. read Shell Setup, and do the opposite).
fnm ships its completions with the binary:
fnm completions --shell <SHELL>
Where <SHELL>
can be one of the supported shells:
bash
ash
zsh
fish
Please follow your shell instructions to install them.
Environment variables need to be setup before you can start using fnm.
This is done by evaluating the output of fnm env
.
To automatically run fnm use
when a directory contains a .node-version
or .nvmrc
file, add the --use-on-cd
option to your shell setup.
Adding a .node-version
to your project is as simple as:
$ node --version
v14.18.3
$ node --version > .node-version
Check out the following guides for the shell you use:
Add the following to your .bashrc
profile:
eval "$(fnm env --use-on-cd)"
Add the following to your .zshrc
profile:
eval "$(fnm env --use-on-cd)"
Create ~/.config/fish/conf.d/fnm.fish
add this line to it:
fnm env --use-on-cd | source
Add the following to the end of your profile file:
fnm env --use-on-cd | Out-String | Invoke-Expression
- Profile is located at
~/.config/powershell/Microsoft.PowerShell_profile.ps1
See the available commands for an extended usage documentation
PRs welcome 🎉
# Install Rust
git clone https://github.com/vanaware/fnm-alpine.git
cd fnm-alpine/
cargo build
cargo run -- --help # Will behave like `fnm --help`
cargo test