<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Brandon C Roberts's blog]]></title><description><![CDATA[Brandon C Roberts's blog]]></description><link>https://brandoncroberts.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 14:10:06 GMT</lastBuildDate><atom:link href="https://brandoncroberts.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Using `.zshrc` file and Homebrew as a Node.js Version Manager and alternative to nvm]]></title><description><![CDATA[Overview
Instead of using nvm (Node Version Manager), you can manage multiple Node.js versions using Homebrew and your
.zshrc
file. This approach involves installing different Node.js versions via Homebrew and updating your PATH environment variable ...]]></description><link>https://brandoncroberts.hashnode.dev/using-zshrc-file-and-homebrew-as-a-nodejs-version-manager-and-alternative-to-nvm</link><guid isPermaLink="true">https://brandoncroberts.hashnode.dev/using-zshrc-file-and-homebrew-as-a-nodejs-version-manager-and-alternative-to-nvm</guid><category><![CDATA[Node.js]]></category><category><![CDATA[nvm]]></category><category><![CDATA[zsh]]></category><category><![CDATA[zshrc]]></category><dc:creator><![CDATA[Brandon C Roberts]]></dc:creator><pubDate>Thu, 19 Sep 2024 09:48:40 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-overview">Overview</h2>
<p>Instead of using <code>nvm</code> (Node Version Manager), you can manage multiple Node.js versions using Homebrew and your</p>
<p>.zshrc</p>
<p>file. This approach involves installing different Node.js versions via Homebrew and updating your <a target="_blank"><code>PATH</code></a> environment variable to switch between versions.</p>
<h2 id="heading-steps-to-set-up">Steps to Set Up</h2>
<ol>
<li><p><strong>Install Node.js Versions via Homebrew:</strong></p>
<pre><code class="lang-sh"> brew install node@16 node@18 node@20 node@22
</code></pre>
</li>
<li><p>Add the following line to your <code>.zshrc</code> file</p>
</li>
</ol>
<pre><code class="lang-sh"><span class="hljs-comment"># Node.js version (Change version number after "node@xx" to change your node version)</span>
<span class="hljs-built_in">export</span> PATH=<span class="hljs-string">"/opt/homebrew/opt/node@20/bin:<span class="hljs-variable">$PATH</span>"</span>
</code></pre>
<ol start="3">
<li><strong>Switch Node.js Versions:</strong> To switch Node.js versions, change the version number in the <code>export PATH</code> line in your <code>.zshrc</code> file. For example, to switch to Node.js 18:</li>
</ol>
<pre><code class="lang-sh"><span class="hljs-built_in">export</span> PATH=<span class="hljs-string">"/opt/homebrew/opt/node@18/bin:<span class="hljs-variable">$PATH</span>"</span>
</code></pre>
<ol start="4">
<li><strong>Apply Changes:</strong> Source your .zshrc file to apply the changes OR simply open a new terminal window.</li>
</ol>
<pre><code class="lang-sh"><span class="hljs-built_in">source</span> ~/.zshrc
</code></pre>
<h2 id="heading-pros-and-cons">Pros and Cons</h2>
<h3 id="heading-using-homebrew-and-zshrc"><strong>Using Homebrew and .zshrc:</strong></h3>
<p><strong>Pros:</strong></p>
<ul>
<li><p><strong>Simplicity:</strong> Straightforward setup and usage.</p>
</li>
<li><p><strong>Integration:</strong> Works seamlessly with Homebrew, which is commonly used on macOS.</p>
</li>
<li><p><strong>No Additional Tools:</strong> No need to install and manage an additional tool like <code>nvm</code>.</p>
</li>
<li><p>Avoids the needs for nvm, which can have compatibility and installation issues on some machines.</p>
</li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li><p><strong>Manual Updates:</strong> Requires manual editing of the .zshrc, instead of typing a terminal command.</p>
</li>
<li><p><strong>Limited Flexibility:</strong> Less flexible compared to <code>nvm</code> for quickly switching between versions or using different versions in different terminal sessions.</p>
</li>
</ul>
<h3 id="heading-using-nvm"><strong>Using</strong> <code>nvm</code>:</h3>
<p><strong>Pros:</strong></p>
<ul>
<li><p><strong>Ease of Use:</strong> Simple commands to switch between Node.js versions (<code>nvm use &lt;version&gt;</code>).</p>
</li>
<li><p><strong>Flexibility:</strong> Allows different terminal sessions to use different Node.js versions.</p>
</li>
<li><p><strong>Project-Specific Versions:</strong> Supports <code>.nvmrc</code> files for project-specific Node.js versions.</p>
</li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li><p>There can be compatibility and installation issues on some machines.</p>
</li>
<li><p><strong>Additional Tool:</strong> Requires installing and managing <code>nvm</code>.</p>
</li>
<li><p><strong>Overhead:</strong> Slightly more overhead in terms of setup and learning curve.</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Using Homebrew and .zshrc to manage Node.js versions is a simple and effective approach if you prefer minimal tooling and are comfortable with manual configuration. However, if you need more flexibility and ease of switching between versions, <code>nvm</code> might be a better choice.</p>
]]></content:encoded></item><item><title><![CDATA[How to Deploy Next.js to AWS ECS | Self-Hosted Next.js]]></title><description><![CDATA[Deploying Next.js apps to AWS ECS can be done quickly and easily.Follow these steps and watch my accompanying Youtube Video to learn how.
Prerequisites:

An AWS Account, that you have configured on your machine using the AWS-CLI's aws configure comma...]]></description><link>https://brandoncroberts.hashnode.dev/how-to-deploy-nextjs-to-aws-ecs-self-hosted-nextjs</link><guid isPermaLink="true">https://brandoncroberts.hashnode.dev/how-to-deploy-nextjs-to-aws-ecs-self-hosted-nextjs</guid><dc:creator><![CDATA[Brandon C Roberts]]></dc:creator><pubDate>Tue, 06 Feb 2024 10:50:37 GMT</pubDate><content:encoded><![CDATA[<p>Deploying Next.js apps to AWS ECS can be done quickly and easily.<br />Follow these steps and watch my accompanying Youtube Video to learn how.</p>
<p>Prerequisites:</p>
<ol>
<li><p>An AWS Account, that you have configured on your machine using the AWS-CLI's <code>aws configure</code> command.</p>
</li>
<li><p>Install `AWS Copilot` by following their install steps here <a target="_blank" href="https://aws.github.io/copilot-cli/docs/getting-started/install/">https://aws.github.io/copilot-cli/docs/getting-started/install/</a></p>
</li>
<li><p>Node.js version &gt;=18 installed on your machine</p>
</li>
</ol>
<p>Steps:</p>
<ol>
<li><p>Create a new Next.js project based on the Docker Example by running <code>npx create-next-app@latest --example=with-docker</code> Link to example here: <a target="_blank" href="https://github.com/vercel/next.js/tree/canary/examples/with-docker">https://github.com/vercel/next.js/tree/canary/examples/with-docker</a></p>
</li>
<li><p>First <code>cd</code> into the Next.js app directory and run <code>copilot init</code></p>
</li>
<li><p>Choose first option `App Runner`, and accept defaults for the rest of the prompts.</p>
</li>
<li><p>And <code>HOSTNAME</code> env variable to the service <code>.yml</code> file.</p>
</li>
<li><p>Visit the running Next.js application given in the terminal output.</p>
</li>
<li><p>Check Lighthouse Score</p>
</li>
<li><p>Run <code>copilot app delete</code></p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[How to move a directory to a new repository along with all git history]]></title><description><![CDATA[Video Tutorial: https://youtu.be/awN4be75HG4?si=l8KGOSoi4XMK6tvqSteps:

Install git-filter-repo

clone both repos using --single-branch command.


https://github.com/redux-toolkit/tree/master
https://github.com/redux/tree/master

In the repo that con...]]></description><link>https://brandoncroberts.hashnode.dev/how-to-move-a-directory-to-a-new-repository-along-with-all-git-history</link><guid isPermaLink="true">https://brandoncroberts.hashnode.dev/how-to-move-a-directory-to-a-new-repository-along-with-all-git-history</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Python 3]]></category><category><![CDATA[Python]]></category><category><![CDATA[Redux]]></category><dc:creator><![CDATA[Brandon C Roberts]]></dc:creator><pubDate>Wed, 01 Nov 2023 11:29:16 GMT</pubDate><content:encoded><![CDATA[<p>Video Tutorial: <a target="_blank" href="https://youtu.be/awN4be75HG4?si=l8KGOSoi4XMK6tvq">https://youtu.be/awN4be75HG4?si=l8KGOSoi4XMK6tvq</a><br />Steps:</p>
<ol>
<li><p>Install git-filter-repo</p>
</li>
<li><p>clone both repos using --single-branch command.</p>
</li>
</ol>
<p><a target="_blank" href="https://github.com/brandoncroberts/redux-toolkit/tree/master">https://github.com/redux-toolkit/tree/master</a></p>
<p><a target="_blank" href="https://github.com/brandoncroberts/redux/tree/master">https://github.com/redux/tree/master</a></p>
<ol>
<li><p>In the repo that contains the directory you want to move to the host repo, run<br /> <code>git filter-repo --path FOLDER-NAME</code></p>
</li>
<li><p>Checkout a new branch on the host repo, in this case the `redux` repo.</p>
<p> <code>git checkout -b feat-move-packages-dir</code></p>
</li>
<li><p>In host repo, run <code>git remote add -f local ../host-repo</code></p>
</li>
<li><p>In host repo run,<br /> <code>git merge --allow-unrelated-histories local/master</code></p>
</li>
</ol>
<p>References:</p>
<p><a target="_blank" href="https://www.continuousimprover.com/2023/02/merging-repositories.html">https://www.continuousimprover.com/2023/02/merging-repositories.html</a></p>
<p><a target="_blank" href="https://docs.github.com/en/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository">https://docs.github.com/en/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository</a></p>
]]></content:encoded></item></channel></rss>