首页 > 代码库 > Mac 无法运行node命令的解决方法

Mac 无法运行node命令的解决方法

在安装node时提示:node-7.2.1 already installed, it‘s just not linked 导致无法运行node命令

按照特定的顺序执行这个命令列表:

sudo brew uninstall node
brew update
brew upgrade
brew cleanup
brew install node
sudo chown -R $(whoami) /usr/local
brew link --overwrite node
brew postinstall node

然后运行 node -v可以看到安装的node版本了

Mac 无法运行node命令的解决方法