美文网首页
使用brew 命令安装Node时提示-bash: brew: c

使用brew 命令安装Node时提示-bash: brew: c

作者: 秋天的田野 | 来源:发表于2017-01-03 14:56 被阅读673次

参照官网上很简单的一句安装命令,

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装完毕后,发现使用brew命令,却总是提示:-bash: brew: command not found

解决方式。其实解决这个问题真的很简单。如下:

sudo vim .bash_profile,打开后接在后面添加,注意:不要换行

export PATH=/usr/local/bin:$PATH

保存,source .bash_profile使配置修改生效。

再次使用brew 命令就ok了。

在使用命令brew install node 安装node时遇到以下错误

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/rbconfig.rb:213: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777

Updating Homebrew...

Error: You must `brew link pkg-config` before node can be installed

而是按照提示 输入brew link pkg-config 接着报错

Error: Could not symlink bin/pkg-config

Target /usr/local/bin/pkg-config

is a symlink belonging to pkg-config. You can unlink it:

brew unlink pkg-config

To force the link and overwrite all conflicting files:

brew link --overwrite pkg-config

To list all files that would be deleted:

brew link --overwrite --dry-run pkg-config

按照上面提示的依次输入brew unlink pkg-config;brew link --overwrite pkg-config;brew link --overwrite --dry-run pkg-config;(每个分号单独一条命令)问题解决

相关文章

网友评论

      本文标题:使用brew 命令安装Node时提示-bash: brew: c

      本文链接:https://www.haomeiwen.com/subject/ycqnvttx.html