NVM Versions

Posted on: November 14th, 2024
By: Tadeo Martinez

Steps to Resolve

  1. Uninstall the Global Node.js (Homebrew Installation): Since /opt/homebrew/bin/node is from Homebrew, you need to uninstall it:bashCopy codebrew uninstall node After uninstalling, verify it’s removed:bashCopy codewhich node If it still points to /opt/homebrew/bin/node, you might need to remove leftover symlinks:bashCopy coderm -rf /opt/homebrew/bin/node
  2. Reload Your Shell: Reload your shell to ensure the changes take effect:bashCopy codesource ~/.zshrc # or ~/.bashrc depending on your shell
  3. Verify nvm Configuration: Ensure that your terminal is loading the nvm environment correctly. Run:bashCopy codecommand -v nvm It should output something like:Copy codenvm
  4. Use nvm to Manage Node: Re-run the following commands to use the nvm-managed Node.js version:bashCopy codenvm install 22 nvm use 22 Then check the version:bashCopy codenode -v It should now display:Copy codev22.11.0
  5. Set Node.js v22 as Default: To ensure that nvm-managed Node.js is always used by default:bashCopy codenvm alias default 22
  6. Verify Again: Open a new terminal and check:bashCopy codenode -v It should still display v22.11.0.

Have any questions or comments? Write them below!


Leave a Reply

Your email address will not be published. Required fields are marked *