Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fernandovega/b3103f40ea8cc4365d910b6f6a18dbf5 to your computer and use it in GitHub Desktop.
Save fernandovega/b3103f40ea8cc4365d910b6f6a18dbf5 to your computer and use it in GitHub Desktop.

Revisions

  1. @nijicha nijicha revised this gist Jul 30, 2019. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@

    ## Getting start

    ### Install NVM and NodeJS
    ### Part A: Install NVM and NodeJS

    1. Install `nvm` via Homebrew

    @@ -53,7 +53,7 @@

    See more about `nvm` : https://github.com/creationix/nvm

    ### Install Yarn
    ### Part B: Install Yarn

    1. Install `yarn` via Homebrew and remove `node` dependencies from Homebrew

    @@ -71,13 +71,15 @@ See more about `nvm` : https://github.com/creationix/nvm
    $ `brew doctor`
    4. Create symbol link from `nvm` for Homebrew
    4. Create symbol link from `nvm` for Homebrew. Pick a choice which suitable for you.
    a. This is for those who installed only one version via nvm
    $ `ln -s ~/.nvm/versions/node/ /usr/local/Cellar/`
    ** Note : If you installed multiple node versions via `nvm`. You should create symbol link by current global version. Following this commands **
    b. If you installed multiple node versions via `nvm`. You should create symbol link by current global version. Following this commands
    $ `nvm current` => v10.16.0 (Latest LTS: Dubnium) (This should be **Current** LTS version)
    $ `nvm current` => v10.16.0 (Latest LTS: Dubnium) (This should be **Global** node version)
    $ `mkdir /usr/local/Cellar/node`
  2. @nijicha nijicha revised this gist Jul 18, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@

    5. Verify `nvm` is installed

    $ `nvm -v`
    $ `nvm --version`

    6. Check all avaliable version by this command

  3. @nijicha nijicha revised this gist Jun 25, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -58,6 +58,7 @@ See more about `nvm` : https://github.com/creationix/nvm
    1. Install `yarn` via Homebrew and remove `node` dependencies from Homebrew

    $ `brew install yarn`

    $ `brew uninstall node --ignore-dependencies`

    2. Checkout `node` in environment `$PATH`
  4. @nijicha nijicha revised this gist Jun 25, 2019. 1 changed file with 8 additions and 7 deletions.
    15 changes: 8 additions & 7 deletions install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -39,9 +39,9 @@

    $ `nvm ls-remote`

    7. Install NodeJS (_Recommended to install LTS version. Current LTS is 8.10.0_)
    7. Install NodeJS (_Recommended to install LTS version. Current LTS is Dubnium_)

    $ `nvm install 8.10.0`
    $ `nvm install --lts='Dubnium'`

    8. Check installed NodeJS in your machine.

    @@ -55,15 +55,16 @@ See more about `nvm` : https://github.com/creationix/nvm

    ### Install Yarn

    1. Install `yarn` via Homebrew without `node` dependencies
    1. Install `yarn` via Homebrew and remove `node` dependencies from Homebrew

    $ `brew install yarn --ignore-dependencies`
    $ `brew install yarn`
    $ `brew uninstall node --ignore-dependencies`

    2. Checkout `node` in environment `$PATH`

    $ `which node`

    It should be return => `/User/<your's-user-name>/.nvm/versions/node/8.10.0/bin/node`
    It should be return => `/User/<your's-user-name>/.nvm/versions/node/<latest-node-lts-version>/bin/node`
    3. Checkout `brew doctor` there should show message **WARNING missing yarn dependencies**
    @@ -75,11 +76,11 @@ See more about `nvm` : https://github.com/creationix/nvm
    ** Note : If you installed multiple node versions via `nvm`. You should create symbol link by current global version. Following this commands **
    $ `nvm current` => v8.10.0
    $ `nvm current` => v10.16.0 (Latest LTS: Dubnium) (This should be **Current** LTS version)
    $ `mkdir /usr/local/Cellar/node`
    $ `ln -s ~/.nvm/versions/node/8.10.0/ /usr/local/Cellar/node`
    $ `ln -s ~/.nvm/versions/node/<latest-node-lts-version>/ /usr/local/Cellar/node`
    4. Checkout `brew doctor` again. There shouldn't have **WARNING** message.
  5. @nijicha nijicha revised this gist Mar 9, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -44,6 +44,7 @@
    $ `nvm install 8.10.0`

    8. Check installed NodeJS in your machine.

    $ `nvm ls`

    9. Set global nodejs version to environment.
  6. @nijicha nijicha revised this gist Mar 9, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,8 @@

    $ `nvm ls-remote`

    7. Install NodeJS (_recommended to install LTS version. Current LTS is 8.10.0_)
    7. Install NodeJS (_Recommended to install LTS version. Current LTS is 8.10.0_)

    $ `nvm install 8.10.0`

    8. Check installed NodeJS in your machine.
  7. @nijicha nijicha revised this gist Mar 9, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -74,7 +74,9 @@ See more about `nvm` : https://github.com/creationix/nvm
    ** Note : If you installed multiple node versions via `nvm`. You should create symbol link by current global version. Following this commands **
    $ `nvm current` => v8.10.0
    $ `mkdir /usr/local/Cellar/node`
    $ `ln -s ~/.nvm/versions/node/8.10.0/ /usr/local/Cellar/node`
    4. Checkout `brew doctor` again. There shouldn't have **WARNING** message.
  8. @nijicha nijicha revised this gist Mar 9, 2018. 1 changed file with 14 additions and 2 deletions.
    16 changes: 14 additions & 2 deletions install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -57,14 +57,26 @@ See more about `nvm` : https://github.com/creationix/nvm

    $ `brew install yarn --ignore-dependencies`

    2. Checkout `brew doctor` there should show message **WARNING missing yarn dependencies**
    2. Checkout `node` in environment `$PATH`

    $ `which node`

    It should be return => `/User/<your's-user-name>/.nvm/versions/node/8.10.0/bin/node`
    3. Checkout `brew doctor` there should show message **WARNING missing yarn dependencies**
    $ `brew doctor`
    3. Create symbol link from `nvm` to Homebrew
    4. Create symbol link from `nvm` for Homebrew
    $ `ln -s ~/.nvm/versions/node/ /usr/local/Cellar/`
    ** Note : If you installed multiple node versions via `nvm`. You should create symbol link by current global version. Following this commands **
    $ `nvm current` => v8.10.0
    $ `mkdir /usr/local/Cellar/node`
    $ `ln -s ~/.nvm/versions/node/8.10.0/ /usr/local/Cellar/node`
    4. Checkout `brew doctor` again. There shouldn't have **WARNING** message.
    $ `brew doctor`
  9. @nijicha nijicha created this gist Mar 9, 2018.
    70 changes: 70 additions & 0 deletions install_nodejs_and_yarn_homebrew.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,70 @@
    # Install NVM, NodeJS, Yarn via Homebrew

    ## Prerequisites
    - [Homebrew](https://brew.sh/) should be installed (Command line tools for Xcode are included).

    ## Getting start

    ### Install NVM and NodeJS

    1. Install `nvm` via Homebrew

    $ `brew install nvm`

    2. Create system directory for nvm

    $ `mkdir ~/.nvm`

    3. Add following line to your profile. (`.profile` or `.zshrc` or `.zprofile`)

    ```bash
    # NVM
    export NVM_DIR=~/.nvm
    source $(brew --prefix nvm)/nvm.sh
    ```

    4. Close and open your terminal again.
    Or Choose one from the following command once for reload your profile. (`.profile` or `.zshrc` or `.zprofile`)

    Example
    - $ `source ~/.profile`
    - $ `source ~/.zshrc`
    - $ `source ~/.zprofile`

    5. Verify `nvm` is installed

    $ `nvm -v`

    6. Check all avaliable version by this command

    $ `nvm ls-remote`

    7. Install NodeJS (_recommended to install LTS version. Current LTS is 8.10.0_)
    $ `nvm install 8.10.0`

    8. Check installed NodeJS in your machine.
    $ `nvm ls`

    9. Set global nodejs version to environment.

    $ `nvm use default`

    See more about `nvm` : https://github.com/creationix/nvm

    ### Install Yarn

    1. Install `yarn` via Homebrew without `node` dependencies

    $ `brew install yarn --ignore-dependencies`

    2. Checkout `brew doctor` there should show message **WARNING missing yarn dependencies**

    $ `brew doctor`

    3. Create symbol link from `nvm` to Homebrew

    $ `ln -s ~/.nvm/versions/node/ /usr/local/Cellar/`

    4. Checkout `brew doctor` again. There shouldn't have **WARNING** message.
    $ `brew doctor`