如何在ubuntu中永久修复Howbrew路径问题

时间:2016-10-29 09:49:32

标签: node.js ubuntu ubuntu-16.04

我正在使用linuxbrew来安装节点。这样做很有效,除非我在执行以下路径导出后才能使用节点。

export PATH="/home/ericel/.linuxbrew/bin:$PATH"

如果我关闭该终端并打开一个新终端,我仍然需要进行相同的PATh导出才能使我的节点正常工作。

无论如何要永久地解决这个问题吗? 我做啤酒医生,我得到以下指示:

ericel@ericel-X401A:~$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: /usr/bin occurs before /home/ericel/.linuxbrew/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
  xzmore
  unlzma
  lzcmp
  brew
  xzegrep
  lzgrep
  lzdiff
  lzless
  lzma
  pkg-config
  xzfgrep
  xzdiff
  xz
  lzfgrep
  lzcat
  lzegrep
  unxz
  xzgrep
  xzcat
  xzless
  lzmore
  lzmainfo
  xzcmp

Consider setting your PATH so that /home/ericel/.linuxbrew/bin
occurs before /usr/bin. Here is a one-liner:
  echo 'export PATH="/home/ericel/.linuxbrew/bin:$PATH"' >> ~/.bash_profile

Warning: Homebrew's bin was not found in your PATH.
Consider setting the PATH for example like so
  echo 'export PATH="/home/ericel/.linuxbrew/bin:$PATH"' >> ~/.bash_profile

Warning: You have a non-Homebrew 'pkg-config' in your PATH:
  /usr/bin/pkg-config

`./configure` may have problems finding brew-installed packages using
this other pkg-config.

Warning: Homebrew's share was not found in your XDG_DATA_DIRS but you have
this variable set to include other locations.
Some programs like `vapigen` may not work correctly.
Consider setting the XDG_DATA_DIRS for example like so
    echo 'export XDG_DATA_DIRS="/home/ericel/.linuxbrew/share:$XDG_DATA_DIRS"' >> ~/.bash_profile

但即使这样做,节点也只适用于那个终端。我使用的是ubuntu 16。**

1 个答案:

答案 0 :(得分:1)

刚出现同样的错误。我想是的,因为我首先从官方页面说明安装了linuxbrew,然后我使用了apt-get。

所以我删除了apt-get安装

sudo apt remove linuxbrew-wrapper

然后只添加了

的路径
nano ~/.bashrc

正如官方文件中所述

echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.bash_profile

然后你需要打开新的终端才能生效。