Node.js 如何在ubuntu中永久解决Howbrew路径问题

Node.js 如何在ubuntu中永久解决Howbrew路径问题,node.js,ubuntu,ubuntu-16.04,Node.js,Ubuntu,Ubuntu 16.04,我正在使用linuxbrew安装node。这很好,除非,因为我只能在执行以下路径导出后使用node export PATH="/home/ericel/.linuxbrew/bin:$PATH" 如果我关闭该终端并打开一个新的终端,我仍然需要执行相同的路径导出以使我的节点工作 有没有办法永久解决这个问题? 我不知道,我得到以下说明: ericel@ericel-X401A:~$ brew doctor Please note that these warnings are just used

我正在使用linuxbrew安装node。这很好,除非,因为我只能在执行以下路径导出后使用node

export PATH="/home/ericel/.linuxbrew/bin:$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.*

也有同样的错误。我想是的,因为我首先根据官方页面说明安装了linuxbrew,然后使用apt get

因此,我删除了apt get安装

sudo apt remove linuxbrew-wrapper
然后就把路径添加到

nano ~/.bashrc
如官方文件所述

echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.bash_profile
然后,您需要打开新的终端以使其生效