我需要安装节点版本10,并按照以下步骤操作
上面的命令给出了错误,因此尝试了
现在我出错了
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile
我已经检查了.bash_profile,并且上面的条目确实存在,却无法理解为什么上面的错误持续显示?
答案 0 :(得分:1)
我相信您仍在运行旧版本的节点。首先,假设已安装节点8,请尝试使用brew uninstall node@8
卸载它。
然后
brew uninstall --ignore-dependencies --force node
brew uninstall --ignore-dependencies --force icu4c
brew install icu4c
brew unlink icu4c && brew link icu4c --force
brew install node@10
几天前,我遇到了同样的问题,并且发现这篇博客文章很有帮助:Mac Brew Node 10 upgrade
答案 1 :(得分:1)
如@quentin所评论,这不是错误,它是参考消息。
第二,我更喜欢使用软件包n
来安装特定版本的Node。 https://www.npmjs.com/package/n
最初,您获得安装的节点的默认版本。然后,您使用n
来试用Node版本。
安装n-$ npm install -g n
安装节点10-$ n 10
安装稳定的节点-$ n stable
最新安装节点-$ n latest
安装节点lts-$ n lts