PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 20, 2022

[FIXED] Why do I need to uninstall node from my computer to use nvm?

 October 20, 2022     development-environment, homebrew, macos, node.js, nvm     No comments   

Issue

I recently decided to install nvm, and the instructions had me uninstall node. I noticed that if I explicitly tell nvm to use a certain version it uses it from the nvm directory, otherwise it uses my bin/node directory, so I didn't notice a conflict. When I uninstalled node, i needed to specify a version every time I use my terminal which seems like an unnecessary step when I could just leave node installed via brew and use nvm if I need to version control.


Solution

Once you install nvm and use Node through it, it does NOT use bin/node, but the version installed with nvm, so your old Node is obsolete.

The main reason they recommend you to uninstall Node is because it could confuse the shell about which Node to use. Of course, you can update your shell config so that it first looks for Node installed from nvm, but that's an unnecessary extra step and your old Node distribution is obsolete on your disk, at best.

So, the best solution is uninstalling the old distribution and install nvm (which by default installs the latest Node in your .nvm folder), and install more versions of Node if necessary.

And regarding this:

i needed to specify a version every time I use my terminal which seems like an unnecessary step

You don't need to, as long as you set the default version (say, 11.15.0) config after installing nvm with the following command:

nvm alias default 11.15.0


Answered By - technophyle
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing