无法使用Brew开关更改节点的版本 [英] Unable to change version of node with brew switch
本文介绍了无法使用Brew开关更改节点的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用节点8.9.1,但是当尝试使用brew更新时,它说已经安装了8.9.1
I'm trying to use node 8.9.1 but when trying to update using brew it says 8.9.1 is already installed
James-MacBook:~ james$ brew upgrade node
Error: node 8.9.1 already installed
但是当检查版本时会显示
But when checking the version it shows
James-MacBook:~ james$ node --version
v0.10.48
所以我试图切换到8.9.1
So then I tried to switch to 8.9.1
James-MacBook:~ james$ brew switch node 8.9.1
Cleaning /usr/local/Cellar/node/8.9.1
7 links created for /usr/local/Cellar/node/8.9.1
但它仍显示为0.10.48
But it is still showing as 0.10.48
James-MacBook:~ james$ node --version
v0.10.48
推荐答案
听起来您已安装了某些版本的节点,而未使用Homebrew.
It sounds like you have some version of node that is installed without using Homebrew.
- 首先,通过检查主目录
ls -la
中是否有.nvm目录来检查是否已使用nvm安装了节点.
- First of all, check if you installed your node with nvm by check if you have a .nvm directory in home directory
ls -la
- 如果这样做,请删除该目录
-
brew update && brew install node@8
(所需的任何节点) -
brew unlink node@0
-
brew link --force node@8
- 进行酿造更新&& brew升级节点@ 8
- if you do, remove that directory
brew update && brew install node@8
(whichever node you want)brew unlink node@0
brew link --force node@8
- Do brew update && brew upgrade node@8
快乐编码
这篇关于无法使用Brew开关更改节点的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文