Home > Enterprise >  node -v showing old version of node
node -v showing old version of node

Time:07-15

I'm on MacOS, and I want my system to use the latest version of nodejs. I've installed the latest version of nodejs from the nodejs website.

node -v gives me: v14.15.0

Running where node in terminal gives me these 2 paths:

/Users/GenTan/.nvm/versions/node/v14.15.0/bin/node

/usr/local/bin/node

I want to remove the v14.15.0, and only have the latest version of node on my system. What's the safest way I can do this?

CodePudding user response:

If you no longer wish to use NVM, you can uninstall it. That way, the only version of Node left in your PATH is the system version.

You could also keep NVM. If you do nvm ls you'll see what versions you've got installed. One of them has a little arrow next to it, which is the current version. For example:

        v15.8.0
->      v16.0.0
        v18.4.0
         system
default -> 16.0 (-> v16.0.0)

Note there's also one called system. If you switch to that one with nvm use system, you'll use the one you installed yourself.

You can then use nvm alias default system to mark that as the default. When you then run nvm ls, you get:

        v15.8.0
        v16.0.0
        v18.4.0
->       system
default -> system
  • Related