Browse Source

Update installation instructions (#341)

remotes/origin/add-with-shims
Gal Schlezinger 5 years ago committed by GitHub
parent
commit
909652aa80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 87
      README.md

87
README.md

@ -56,7 +56,7 @@ Example: @@ -56,7 +56,7 @@ Example:
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "./.fnm" --skip-shell
```
### Manually (OSX/Linux/Windows)
### Manually
#### Using Homebrew (OSX)
@ -64,13 +64,23 @@ curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "./.fnm" -- @@ -64,13 +64,23 @@ curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "./.fnm" --
brew install fnm
```
Then, [set up your shell for fnm](#shell-setup)
#### Using Scoop (Windows)
```bash
scoop install fnm
```
Then apply the changes the installer prints, to set up your shell profile.
Then, [set up your shell for fnm](#shell-setup)
#### Using Cargo (Linux/Mac/Windows)
```bash
cargo install fnm
```
Then, [set up your shell for fnm](#shell-setup)
#### Using a release binary (Linux/Mac/Windows)
@ -78,55 +88,70 @@ Then apply the changes the installer prints, to set up your shell profile. @@ -78,55 +88,70 @@ Then apply the changes the installer prints, to set up your shell profile.
- Make it available globally on `PATH` environment variable
- Configure your shell profile:
- For **Bash** or **Zsh** users, add the following to your `.bashrc`/`.zshrc` respectively:
## Completions
```bash
eval "$(fnm env)"
```
fnm ships its completions with the binary:
- For [**Fish Shell**](https://fishshell.com/) users, create `~/.config/fish/conf.d/fnm.fish` add this line to it:
```
fnm completions --shell <SHELL>
```
```fish
fnm env | source
```
Where `<SHELL>` can be one of the supported shells:
- For **PowerShell** users, add the following to the end of your profile file::
- `bash`
- `zsh`
- `fish`
- `powershell`
```powershell
fnm env --use-on-cd | Out-String | Invoke-Expression
```
Please follow your shell instructions to install them.
- On Windows, the profile is located at `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`
- For Mac/Linux, the profile is located at `~/.config/powershell/Microsoft.PowerShell_profile.ps1`
### Shell Setup
- For **WinCMD**, aka good old **Windows Command Prompt** or **Batch**, fnm is also supported but is not entirely covered. [You can set up a startup script](https://superuser.com/a/144348) and append the following line:
fnm needs to run some shell commands before you can start using it.
This is done by evaluating the output of `fnm env`. Check out the following guides for the shell you use:
```
FOR /f "tokens=*" %i IN ('fnm env --use-on-cd') DO CALL %i
```
#### Bash
#### Using Cargo (Linux/Mac/Windows)
add the following to your `.bashrc` profile:
```bash
cargo install fnm
eval "$(fnm env)"
```
## Completions
#### Zsh
fnm ships its completions with the binary:
add the following to your `.zshrc` profile:
```zsh
eval "$(fnm env)"
```
fnm completions --shell <SHELL>
#### Fish shell
create `~/.config/fish/conf.d/fnm.fish` add this line to it:
```fish
fnm env | source
```
Where `<SHELL>` can be one of the supported shells:
#### PowerShell
- `bash`
- `zsh`
- `fish`
- `powershell`
add the following to the end of your profile file::
Please follow your shell instructions to install them.
```powershell
fnm env --use-on-cd | Out-String | Invoke-Expression
```
- On Windows, the profile is located at `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`
- For Mac/Linux, the profile is located at `~/.config/powershell/Microsoft.PowerShell_profile.ps1`
#### Windows Command Prompt aka Batch aka WinCMD
fnm is also supported but is not entirely covered. [You can set up a startup script](https://superuser.com/a/144348) and append the following line:
```
FOR /f "tokens=*" %i IN ('fnm env --use-on-cd') DO CALL %i
```
## Usage

Loading…
Cancel
Save