{"id":14965822,"url":"https://github.com/nijicha/install_nodejs_and_yarn_homebrew","last_synced_at":"2025-04-07T11:08:14.983Z","repository":{"id":56626782,"uuid":"210310486","full_name":"nijicha/install_nodejs_and_yarn_homebrew","owner":"nijicha","description":"A step-by-step guideline to setup node bundle (node, npm, npx) and yarn via homebrew (managed by asdf-vm) on UNIX base machine","archived":false,"fork":false,"pushed_at":"2022-04-21T15:33:34.000Z","size":17,"stargazers_count":331,"open_issues_count":0,"forks_count":36,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-31T09:06:56.322Z","etag":null,"topics":["asdf-vm","brew","homebrew","nodejs","yarn"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nijicha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"nijicha"}},"created_at":"2019-09-23T09:04:35.000Z","updated_at":"2025-03-21T14:56:03.000Z","dependencies_parsed_at":"2022-08-15T22:10:45.397Z","dependency_job_id":null,"html_url":"https://github.com/nijicha/install_nodejs_and_yarn_homebrew","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijicha%2Finstall_nodejs_and_yarn_homebrew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijicha%2Finstall_nodejs_and_yarn_homebrew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijicha%2Finstall_nodejs_and_yarn_homebrew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijicha%2Finstall_nodejs_and_yarn_homebrew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nijicha","download_url":"https://codeload.github.com/nijicha/install_nodejs_and_yarn_homebrew/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640464,"owners_count":20971557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asdf-vm","brew","homebrew","nodejs","yarn"],"created_at":"2024-09-24T13:35:23.786Z","updated_at":"2025-04-07T11:08:14.959Z","avatar_url":"https://github.com/nijicha.png","language":null,"funding_links":["https://ko-fi.com/nijicha"],"categories":[],"sub_categories":[],"readme":"# Install NodeJS, Yarn via Homebrew\n\n## Notice\n\u003e Thank you everyone. For became a stargazers.\n\u003e\n\u003e I had created this guideline for personal note purpose (first on [Gist](https://gist.github.com/nijicha/e5615548181676873118df79953cb709) and then this repository)\n\u003e\n\u003e Pull request is available. Please help me contribute this one 😂.\n\u003e \n\u003e Legacy note (guideline) had moved to branch `legacy-note`\n\n## Prerequisites\n- [Homebrew](https://brew.sh/) should be installed (Command line tools for Xcode are included).\n\n## Getting started\n\n### Part A: Install asdf-vm (A parts from official [website](https://asdf-vm.com/guide/getting-started.html#_1-install-dependencies))\n\n1. Install `asdf` via Homebrew. Current `asdf-vm` version is `0.10.0`\n   ```shell\n   brew install asdf\n   \n   brew install gpg gawk # These are `asdf-nodejs` plugin dependencies\n   ``` \n\n2. Add following line to your profile. (`.profile` or `.zshrc` or `.zprofile`)\n\n    ```shell\n    # asdf\n    [ -s \"/$(brew --prefix asdf)/libexec/asdf.sh\" ] \u0026\u0026 . $(brew --prefix asdf)/libexec/asdf.sh\n    ```\n    \n3. Close and open your terminal again.\n  Or Choose one from the following command once for reload your profile. (`.profile` or `.zshrc` or `.zprofile`)\n  \n    Example\n      - `source ~/.profile`\n      - `source ~/.zshrc`\n      - `source ~/.zprofile`\n      \n4. Verify `asdf` is installed\n\n    `asdf version`\n    \n5. Install `asdf` plugins\n\n    ```shell\n    asdf plugin add nodejs\n    asdf plugin add yarn\n    ```\n\n6. Verify `asdf` and `plugins` are ready!\n\n    ```shell\n    ❯ asdf list\n\n    nodejs\n    No versions installed\n    yarn\n    No versions installed\n    ```\n\n### Part B: Install nodejs and yarn\n\n\u003e **NOTE**\n\u003e\n\u003e If you are matched to these condition below. [You must install NodeJS v16+ (LTS Gallium)](https://doesitarm.com/app/nodejs/)\n\u003e\n\u003e - Using Apple Silicon machine ✅\n\u003e - Installed `homebrew` on Native build (homebrew PATH: `/opt/homebrew`) ✅\n\u003e\n\u003e Alternatively, If your had configured your **SHELL** to support Homebrew native \u0026 Homebrew rosetta2 (e.g. script below like I did)\n\u003e You can install `v15` or lower via Homebrew rosetta2. But I prefer to use v16+ (LTS Gallium)\n\n```bash\n# My .zprofile\n\n# Apple M1\nif [ \"$(uname -m)\" = \"arm64\" ]; then\n  # Use arm64 brew, with fallback to x86 brew\n  if [ -f /opt/homebrew/bin/brew ]; then\n    export PATH=\"/usr/local/bin${PATH+:$PATH}\";\n    eval $(/opt/homebrew/bin/brew shellenv)\n  fi\nelse\n  # Use x86 brew, with fallback to arm64 brew\n  if [ -f /usr/local/bin/brew ]; then\n    export PATH=\"/opt/homebrew/bin${PATH+:$PATH}\";\n    eval $(/usr/local/bin/brew shellenv)\n  fi\nfi\n```\n\n1. Install `nodejs` and `yarn`\n\n   Current LTS nodejs version is `16.14.x`, Codename: `Gallium`\n\n    ```shell\n    asdf install nodejs lts\n    asdf install yarn latest\n    ```\n\n2. Set `nodejs` and `yarn` globally for your machine\n\n    ```shell\n    asdf global nodejs lts\n    asdf global yarn latest\n    ```\n\n3. Verify they are installed\n\n    ```shell\n    ❯ node -v\n    v16.14.2\n\n    ❯ npm -v\n    8.5.0\n\n    ❯ npx -v\n    8.5.0\n\n    ❯ yarn -v\n    1.22.18\n\n    ❯ asdf list\n    nodejs\n    16.14.2\n    lts\n    yarn\n    1.22.18\n\n    ❯ asdf current\n    nodejs          lts             /Users/nijicha/.tool-versions\n    yarn            1.22.18         /Users/nijicha/.tool-versions\n    ```\n\n4. Enjoy! 🥳 ❤️\n\n## Read more\n- https://asdf-vm.com\n- https://github.com/asdf-vm/asdf-nodejs\n- https://github.com/twuni/asdf-yarn\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnijicha%2Finstall_nodejs_and_yarn_homebrew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnijicha%2Finstall_nodejs_and_yarn_homebrew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnijicha%2Finstall_nodejs_and_yarn_homebrew/lists"}