【问题标题】:Conflicting Node.js Installations for NativeScriptNativeScript 的 Node.js 安装冲突
【发布时间】:2019-07-27 00:27:26
【问题描述】:

在 NativeScript 安装期间,我(部分意外)在我的 macOS High Sierra 10.13.4 上安装了两次 Node.js - 现在我相信我会遇到一些冲突错误。

我从https://nodejs.org 安装了最新的 LTS 版本的 Node.js,一切正常。

然后,进一步阅读 NativeScript 安装文档,建议使用 Homebrew 然后安装:

brew install node@10

我相信它再次安装了 Node.js,我收到了以下警告。

我想知道是否有人可以推荐如何纠正这个问题(我当然不需要运行两个版本的 Node.js)。我只需要在推荐的 Homebrew 环境中使用 NativeScript。谢谢!

==> Installing dependencies for node@10: icu4c
==> Installing node@10 dependency: icu4c
==> Downloading https://homebrew.bintray.com/bottles/icu4c-64.2.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/02/02afdd6a472c31351e46a3b2a38c1c77354f0cc9199c3dbd7e06bc171b3638a2?__gda__=exp=1564186180~hmac=4a70d
######################################################################## 100.0%
==> Pouring icu4c-64.2.high_sierra.bottle.tar.gz
==> Caveats
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
  echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/usr/local/opt/icu4c/lib"
  export CPPFLAGS="-I/usr/local/opt/icu4c/include"

==> Summary
????  /usr/local/Cellar/icu4c/64.2: 257 files, 69.5MB
==> Installing node@10
==> Downloading https://homebrew.bintray.com/bottles/node@10-10.16.0.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/d5/d598385086c33d21b9d28ed8ca4f4a6e3665a7a2c17d9aa244b13ca17d171176?__gda__=exp=1564186247~hmac=830c7
######################################################################## 100.0%
==> Pouring node@10-10.16.0.high_sierra.bottle.tar.gz
==> Caveats
node@10 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have node@10 first in your PATH run:
  echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile

For compilers to find node@10 you may need to set:
  export LDFLAGS="-L/usr/local/opt/node@10/lib"
  export CPPFLAGS="-I/usr/local/opt/node@10/include"

==> Summary
????  /usr/local/Cellar/node@10/10.16.0: 4,144 files, 49.3MB
==> `brew cleanup` has not been run in 30 days, running now...
==> Caveats
==> icu4c
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
  echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/usr/local/opt/icu4c/lib"
  export CPPFLAGS="-I/usr/local/opt/icu4c/include"

==> node@10
node@10 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have node@10 first in your PATH run:
  echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile

For compilers to find node@10 you may need to set:
  export LDFLAGS="-L/usr/local/opt/node@10/lib"
  export CPPFLAGS="-I/usr/local/opt/node@10/include"```

【问题讨论】:

    标签: node.js nativescript homebrew


    【解决方案1】:

    您运行的最后一个命令已安装 node.js 10.16.0。 您可以轻松检查您目前拥有的 node.js 版本: node -v。 这意味着它将覆盖任何以前安装的 node.js,除非你使用了一些 node.js 版本管理工具,比如nvm。 既然你没有提到我认为情况并非如此。

    【讨论】:

    • 是的,但问题是我相信我现在安装了两个版本的 node.js - 一个在/usr/local/opt/node@10/,另一个在/usr。这是我的担忧。因为node@10 is keg-only, which means it was not symlinked into /usr/local, because this is an alternate version of another formula. 的消息不就是这个意思吗?
    • 您确定node -v 为您打印了正确的版本吗?如果是这样,您可以放心,您会遵守 NativeScript 的建议。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-13
    • 2016-07-06
    • 2016-01-09
    • 1970-01-01
    • 2012-01-23
    • 2020-11-06
    相关资源
    最近更新 更多