如何在ubuntu中永久解决Howbrewpath问题

我正在使用linuxbrew来安装节点。 这很好,除非,我只能使用节点后,我做了以下path导出的事实。

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

如果我closures那个terminal并打开一个新的terminal,我仍然必须执行相同的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 

但即使这样做,节点将只为那个terminal工作。 我使用的是Ubuntu 16。**

刚刚有相同的错误。 我想是的,因为我首先从官方页面指令安装linuxbrew,然后我使用apt-get。

所以我删除了apt-get安装

 sudo apt remove linuxbrew-wrapper 

然后只是添加路径

 nano ~/.bashrc 

如正式文件中所写

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

那么你需要打开新的终端才能生效。