网上看到的解决方案:
解决方案
打开终端 执行下面的四句 命令:
$ brew update
$ brew uninstall node
$ brew install node
$ sudo brew postinstall node
# brew error message provided this recommendation; only worked with sudo
to test that npm is working (tho appears to build an index, which not everyone may want):
意思是测试npm是否有用.
$ npm search # returns long list of packages
本文提供了一种解决Node.js安装问题的方法,通过卸载现有版本并重新安装来确保npm正常工作。
4345

被折叠的 条评论
为什么被折叠?



