【问题标题】:Brew install node --without-npm failsBrew install node --without-npm 失败
【发布时间】:2016-07-31 21:18:45
【问题描述】:

关注John Papa's post on 'How to use npm global without sudo on OSX' 我正在跑步

brew install node --without-npm

我收到此信息/错误:

/usr/local > brew install node --without-npm
==> Downloading https://nodejs.org/dist/v5.10.1/node-v5.10.1.tar.xz
Already downloaded: /Library/Caches/Homebrew/node-5.10.1.tar.xz
==> Downloading https://ssl.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz
Already downloaded: /Library/Caches/Homebrew/node--icu4c-56.1.tgz
==> ./configure --prefix=/usr/local/Cellar/node/5.10.1 --without-npm --with-intl
==> make install
Last 15 lines from /Users/justin/Library/Logs/Homebrew/node/02.make:
#include <limits>
         ^
In file included from ../deps/gtest/src/gtest-death-test.cc:34:
In file included from ../deps/gtest/include/gtest/gtest-death-test.h:41:
In file included from ../deps/gtest/include/gtest/internal/gtest-death-test-internal.h:40:
In file included from ../deps/gtest/include/gtest/internal/gtest-internal.h:40:
../deps/gtest/include/gtest/internal/gtest-port.h:259:10: fatal error: 'ctype.h' file not found
#include <ctype.h>   // for isspace, etc
         ^
1 error generated.
make[1]: *** [/private/tmp/node20160410-11435-157r8bn/node-v5.10.1/out/Release/obj.target/gtest/deps/gtest/src/gtest-filepath.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [/private/tmp/node20160410-11435-157r8bn/node-v5.10.1/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o] Error 1
make: *** [node] Error 2

Homebrew's troubleshooting instructions 之后,我跑了两次brew updatebrew doctor——但仍然没有运气。我对自制软件不熟悉,并且有一段时间没有弄乱这些东西了。任何想法这些错误意味着什么?

【问题讨论】:

    标签: node.js macos terminal homebrew


    【解决方案1】:

    您似乎没有安装命令行开发人员工具。在使用 Homebrew 安装 Node 之前,请尝试在终端中执行以下命令:

    xcode-select --install
    

    如果安装成功,将显示此消息:

    xcode-select: error: command line tools are already installed, use "Software Update" to install updates
    

    安装完成后,再次运行brew命令。

    ctype.h 文件应该是 /usr/include/ctype.h 这样的地方。

    【讨论】:

    • 要添加到此答案中的一件事。您可能需要更新到最新版本的 xCode。我安装了命令行工具并克服了这个错误,但最终出现了另一个错误。查看brew doctor 的输出表明xCode 已过时。 xCode更新后,构建成功。
    • 我最终选择了使用NVM 的路线,从而绕过了解决错误和处理权限问题的需要。话虽如此,这似乎确实使错误消失了——标记为正确。
    猜你喜欢
    • 2019-08-30
    • 2012-01-29
    • 1970-01-01
    • 2020-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-03
    • 1970-01-01
    相关资源
    最近更新 更多