All Projects → nijicha → Install_nodejs_and_yarn_homebrew

nijicha / Install_nodejs_and_yarn_homebrew

Licence: mit
The guide for installing nvm | node | yarn via homebrew

Projects that are alternatives of or similar to Install nodejs and yarn homebrew

Kymsu
Keep Your macOs Stuff Updated (KYMSU)
Stars: ✭ 119 (-54.41%)
Mutual labels:  homebrew, yarn, brew
cleanmymac
A developer friendly command line cleaner program for modern macOS systems
Stars: ✭ 35 (-86.59%)
Mutual labels:  homebrew, brew, yarn
awesome-env-config-cn
各种开发语言项目环境国内(中国国内加速镜像)配置教程和部分实践经验,包括github.com, nodejs,npm,nvm, yarn, java, maven, gradle, python, mysys2, elasticsearch, php,golang等等,更多正在加入中...
Stars: ✭ 50 (-80.84%)
Mutual labels:  yarn, nvm
MacOS-All-In-One-Update-Script
Mac update shell script (Appstore, macOS, Homebrew and others)
Stars: ✭ 39 (-85.06%)
Mutual labels:  homebrew, yarn
rubydoc.brew.sh
📖 An online Ruby documentation browser for Homebrew/brew
Stars: ✭ 13 (-95.02%)
Mutual labels:  homebrew, brew
Kubefwd
Bulk port forwarding Kubernetes services for local development.
Stars: ✭ 2,713 (+939.46%)
Mutual labels:  homebrew, brew
Brew
🍺🐧 The Homebrew package manager for Linux
Stars: ✭ 2,600 (+896.17%)
Mutual labels:  homebrew, brew
macstrap
Set up your macOS from scratch.
Stars: ✭ 16 (-93.87%)
Mutual labels:  homebrew, brew
puppet-homebrew
homebrew (+brewcask! +taps!) package installer and provider
Stars: ✭ 17 (-93.49%)
Mutual labels:  homebrew, brew
ibrew
🍻Interactive CLI for Homebrew – the missing package manager for macOS.
Stars: ✭ 33 (-87.36%)
Mutual labels:  homebrew, brew
phpmon
Lightweight, native Mac menu bar app that interacts with Laravel Valet. Helps you manage multiple PHP installations, locate config files and more.
Stars: ✭ 1,896 (+626.44%)
Mutual labels:  homebrew, brew
Ansible Role Homebrew
Ansible Role - Homebrew
Stars: ✭ 195 (-25.29%)
Mutual labels:  homebrew, brew
Txeh
Go library and CLI utilty for /etc/hosts management.
Stars: ✭ 181 (-30.65%)
Mutual labels:  homebrew, brew
Iterm Fish Fisher Osx
Complete guide and Bash script to install Command Line Tools + Homebrew + iTerm2 + Fish Shell + Fisher + Plugins for development purposes
Stars: ✭ 249 (-4.6%)
Mutual labels:  homebrew, brew
Aliddns
aliyun ddns for golang【阿里云DDNS服务,用来将自己的动态IP同步到自己的域名解析服务器,安装方便,配置简单,默认支持Linux和MacOS以后台服务方式持续运行】
Stars: ✭ 136 (-47.89%)
Mutual labels:  homebrew, brew
.config
⚙️ Bootstrappable user environment for macOS & Ubuntu
Stars: ✭ 31 (-88.12%)
Mutual labels:  homebrew, brew
Homebrew Emacs Plus
Emacs Plus formulae for the Homebrew package manager
Stars: ✭ 965 (+269.73%)
Mutual labels:  homebrew, brew
Dotfiles
Get started with your own dotfiles.
Stars: ✭ 1,094 (+319.16%)
Mutual labels:  homebrew, brew
meta-package-manager
🎁 a wrapper around all package managers
Stars: ✭ 277 (+6.13%)
Mutual labels:  homebrew, yarn
setup-linux-debian
Installs essential JavaScript development programs.
Stars: ✭ 16 (-93.87%)
Mutual labels:  yarn, nvm

Install NVM, NodeJS, Yarn via Homebrew

Notice

Move from this Gist

Pull request is available. Please help me contribute this one 😂.

Prerequisites

  • Homebrew should be installed (Command line tools for Xcode are included).

Getting start

Part A: Install NVM and NodeJS

  1. Install nvm via Homebrew

    $ brew install nvm

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

    # NVM
    export NVM_DIR=~/.nvm
    source $(brew --prefix nvm)/nvm.sh
    
  3. 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
  4. Verify nvm is installed

    $ nvm --version

  5. Check all available version by this command

    $ nvm ls-remote

  6. Install NodeJS (Recommended to install LTS version. Current LTS is Fermium)

    $ nvm install --lts=Fermium

  7. Check installed NodeJS in your machine.

    $ nvm ls

  8. Set global nodejs version to environment.

    $ nvm use default

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

Part B: Install Yarn and Linked nvm node to Homebrew

  1. Install yarn via Homebrew

    $ brew install yarn

  2. Remove node dependencies from Homebrew

    $ brew uninstall node --ignore-dependencies

  3. Checkout node in environment $PATH

    $ which node

    It should be return => /User/<your-user-name>/.nvm/versions/node/<latest-node-lts-version>/bin/node

  4. Checkout brew doctor there should show message WARNING missing yarn dependencies

    $ brew doctor

  5. Create blank folder and create symbol link node folder from nvm for yarn in Homebrew.

    $ nvm current => v14.15.0 (Latest LTS: Fermium) (This should be Global node version)

    $ mkdir /usr/local/Cellar/node

    $ ln -s ~/.nvm/versions/node/$(nvm current)/ /usr/local/Cellar/node

  6. Overwrite node, npm and npx from linked node in /usr/local/Cellar/node to /usr/local/bin/ homebrew

    $ brew link --overwrite node

  7. Checkout ls -la /usr/local/bin to see overwrited node, npm and npx

  8. Checkout brew doctor again. There shouldn't have WARNING message.

    $ brew doctor

  9. Prevent Homebrew upgrading node version

    $ brew pin node

  10. Enjoy ! ❤️

Part C: Upgrading, To change node.js version and Re-configure Homebrew

  1. Checkout nvm for to use node version (For this example case I will use LTS Fermium)

    $ nvm list

    $ nvm list
    ->      v12.13.1
            system
    default -> 12.13.1 (-> v12.13.1)
    node -> stable (-> v12.13.1) (default)
    stable -> 12.13 (-> v12.13.1) (default)
    iojs -> N/A (default)
    unstable -> N/A (default)
    lts/* -> lts/erbium (-> v12.13.1)
    lts/argon -> v4.9.1 (-> N/A)
    lts/boron -> v6.17.1 (-> N/A)
    lts/carbon -> v8.16.2 (-> N/A)
    lts/dubnium -> v10.17.0 (-> N/A)
    lts/erbium -> v12.13.1
    

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

  2. Remove the symbol link which we linked node in Homebrew /usr/local/Cellar/node

    $ rm -rf /usr/local/Cellar/node

  3. Unpin node in Homebrew for upgrading yarn

    $ brew unpin node

  4. Upgrade yarn

    $ brew upgrade yarn

  5. Continue on Part B 2. - 10. steps again.

  6. Say yay 😝

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].