我正在尝试在 Mac v 10.12.2 中使用
安装 Homebrewbrew install node
但我收到了这些错误:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/Homebrew/global.rb:3:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/brew.rb:15:in `<main>'
1-首先,安装 Homebrew。
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2-然后运行 brew update 以确保 Homebrew 是最新的。
brew update
3- 作为一项安全措施,您应该运行 brew doctor 以确保您的系统已准备好进行 brew。运行以下命令并遵循 brew doctor 的任何建议。
brew doctor
4-接下来,将 Homebrew 的位置添加到 .bash_profile 或 .zshrc 文件中的 $PATH。
export PATH="/usr/local/binPATH"
5-接下来,安装Node(npm会随Node一起安装):
brew install node
6-要测试您的 Node 和 npm 安装,请尝试安装 Grunt(可能会要求您使用 sudo 运行):
npm install -g grunt-cli
关于ios - 在 Mac 上安装 Homebrew,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41553442/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |