ios - 在 Mac 上安装 Homebrew
<p><p>我正在尝试在 Mac v 10.12.2 中使用</p>安装 Homebrew
<pre><code>brew install node
</code></pre>
<p>但我收到了这些错误:</p>
<pre><code>/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>'
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>1-首先,安装 Homebrew。</p>
<pre><code>/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
</code></pre>
<p>2-然后运行 brew update 以确保 Homebrew 是最新的。</p>
<pre><code>brew update
</code></pre>
<p>3- 作为一项安全措施,您应该运行 brew doctor 以确保您的系统已准备好进行 brew。运行以下命令并遵循 brew doctor 的任何建议。</p>
<pre><code>brew doctor
</code></pre>
<p>4-接下来,将 Homebrew 的位置添加到 .bash_profile 或 .zshrc 文件中的 $PATH。</p>
<pre><code>export PATH="/usr/local/bin:$PATH"
</code></pre>
<p>5-接下来,安装Node(npm会随Node一起安装):</p>
<pre><code>brew install node
</code></pre>
<p>6-要测试您的 Node 和 npm 安装,请尝试安装 Grunt(可能会要求您使用 sudo 运行):</p>
<pre><code>npm install -g grunt-cli
</code></pre></p>
<p style="font-size: 20px;">关于ios - 在 Mac 上安装 Homebrew,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/41553442/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/41553442/
</a>
</p>
页:
[1]