-2

I am on Mac 11.6 (20G165).

I have node.js v10 installed and want to upgrade to v12.

However, when I type brew upgrade node, I got this:

$brew upgrade node
Error: node not installed

I think it's because I didn't install node via homebrew before. But it's been such a long time and I couldn't remember what exact source/channel did I choose to install node long ago.

So what I can do to fix all this?

AGamePlayer
  • 7,404
  • 19
  • 62
  • 119

2 Answers2

0

If you have NVM installed you can run:

nvm install 12.14.1

then set the default Node with:

nvm alias default v12.14.1

Validate:

node -v
DᴀʀᴛʜVᴀᴅᴇʀ
  • 7,681
  • 17
  • 73
  • 127
0

As you said, the problem is with the installed version. you are not installed nodejs with homebrew previously.

So, if you want to install it with brew and use its benefits (like upgrading) try to uninstall the currently installed version with the instruction in this post.

Then, install the latest version via brew command:

brew install node

More on brew documentation.

nima
  • 7,796
  • 12
  • 36
  • 53