Updating Nodejs on mac

0 votes

I'm using macOS Big Sur and would like to upgrade my Node. However, after downloading and installing the file from the official website, my terminal still displays and uses the old node version.

Is there anyone who can help me solve this problem?

image

Thanks

Jun 16, 2022 in Node-js by Vaani
• 7,070 points
704 views

1 answer to this question.

0 votes

I recommend that you use nvm. It's a lot easier and eliminates the hassle of updating.

nvm

To do this, you can install nvm. https://github.com/nvm-sh/nvm#installing-and-updating

you will be pasting in the curl command curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Note: when this is finished running, you should see a line near the bottom which says something like export NVM_DIR="$HOME/.nvm"

Copy and paste this and hit enter.

Then check to make sure you have nvm installed now nvm -v

Nodejs update

After, in the terminal, type: nvm install node (you can also check your current version first with node -v

Run it and then check node version again. It should be updated.

npm

While you're at it, you can also update npm.

Check version npm -v Update npm install -g npm

This should do it. Let me know if there are any issues. Note: this can all be done in the -zsh shell, no reason to move back to bash.

answered Jun 17, 2022 by Neha
• 9,020 points

Related Questions In Node-js

0 votes
0 answers

updating nodejs on ubuntu 16.04

When I used the node -v command ...READ MORE

Jun 27, 2022 in Node-js by Vaani
• 7,070 points
797 views
0 votes
1 answer

Error:Nodejs cannot find installed module on Windows

Hello @kartik, Add an environment variable called NODE_PATH and set ...READ MORE

answered Jul 15, 2020 in Node-js by Niroj
• 82,840 points
4,902 views
0 votes
1 answer

File Download on NodeJS with use opensubtitles API

The problem is the charset output (default ...READ MORE

answered Jun 7, 2022 in Node-js by Neha
• 9,020 points
995 views
0 votes
1 answer

NodeJS express get request is not working on mobile

For your API call, try to add ...READ MORE

answered Jun 7, 2022 in Node-js by Neha
• 9,020 points
1,944 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,927 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,455 views
0 votes
0 answers

How to install Node 14 version on windows?

I'm trying to install Node.js 14 on ...READ MORE

Jun 21, 2022 in Node-js by Vaani
• 7,070 points
2,428 views
0 votes
1 answer

How to host MEAN stack application with Angular and nodejs on windows IIS

It's fine that you're using Angular. Be ...READ MORE

answered May 27, 2022 in Node-js by Neha
• 9,020 points
1,342 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP