title: How to change my version of node using a script?
body: <p>I'm trying to write scripts that allow me to switch my development environment.</p>
  <p>I want to write a script so that I can call it like this:</p>
  <p><code>switchdevA</code></p>
  <p>and inside that script, one of the things it should do is switch to node v16.16.0</p>
  <p>inside switchdevA i have the following:</p>
  <pre><code>#!/bin/zsh
  source ~/.zshrc
  nvm use v16.16.0
  </code></pre>
  <p>the output says that I have switched to node v16.16.0, but when I type <code>node -v</code> I get:</p>
  <p><code>v12.22.12</code></p>
  <p>I can fix if i call <code>source switchdevA</code>, but should I do it that way? Other things like java don't seem to require me sourcing. In addition, the installation is lost if I start a new zsh session, ideally it should install for the current session and all future sessions.</p>
  <p>What's the best practice around this?</p>