From 0f25994c8ef6b7534a0f70aff3c7353a05b0862a Mon Sep 17 00:00:00 2001 From: rouzbeh84 Date: Thu, 6 Apr 2017 16:23:50 -0700 Subject: [PATCH] [Docs] git install update - added git as the last method before full manual install. - added the directory on `git clone` command - added the `git checkout v0.33.1` as the -v gets updated automatically --- README.markdown | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/README.markdown b/README.markdown index 8fe2e25..eebaab3 100644 --- a/README.markdown +++ b/README.markdown @@ -7,6 +7,7 @@ - [Installation](#installation) - [Install script](#install-script) - [Verify installation](#verify-installation) + - [Git Install](#git-install) - [Manual install](#manual-install) - [Manual upgrade](#manual-upgrade) - [Usage](#usage) @@ -107,16 +108,27 @@ command -v nvm which should output 'nvm' if the installation was successful. Please note that `which nvm` will not work, since `nvm` is a sourced shell function, not an executable binary. -### Manual install +### Git install -For manual install create a folder somewhere in your filesystem with the `nvm.sh` file inside it. I put mine in `~/.nvm`. +If you have `git` installed (requires git v1.7+): -Or if you have `git` installed (requires git v1.7+): - -1. clone this repo -1. check out the latest version +1. clone this repo in the root of your user profile + - `cd ~/` from anywhere then `git clone https://github.com/creationix/nvm.git .nvm` +1. check out the latest version with `git checkout v0.33.1` 1. activate nvm by sourcing it from your shell +Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login: +(you may have to add to more than one of the above files) + +```sh +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm +``` + +### Manual Install + +For a fully manual install, create a folder somewhere in your filesystem with the `nvm.sh` file inside it. I put mine in `~/.nvm` and added the following to the `nvm.sh` file. + ```sh export NVM_DIR="$HOME/.nvm" && ( git clone https://github.com/creationix/nvm.git "$NVM_DIR" @@ -125,7 +137,7 @@ export NVM_DIR="$HOME/.nvm" && ( ) && . "$NVM_DIR/nvm.sh" ``` -Add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login: +Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login: (you may have to add to more than one of the above files) ```sh