【问题标题】:node.js build error on cygwincygwin上的node.js构建错误
【发布时间】:2013-11-16 19:48:52
【问题描述】:

我在 Windows 7 机器上使用 cygwin 并使用以下指令安装 node.js: https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)

当我尝试构建时,我不断收到以下错误。 ./configure 工作正常,但 make 命令给我带来了麻烦。我到处寻找,但无法找到答案。有谁知道出了什么问题?

user-THINK ~/node-v0.4.12
$ ./configure
Checking for program g++ or c++          : /usr/bin/g++
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for g++                         : ok
Checking for program gcc or cc           : /usr/bin/gcc
Checking for gcc                         : ok
Checking for library dl                  : yes
Checking for openssl                     : yes
Checking for library util                : yes
Checking for library rt                  : yes
--- libeio ---
Checking for library pthread             : yes
Checking for function pthread_create     : yes
Checking for function pthread_atfork     : yes
Checking for futimes(2)                  : yes
Checking for readahead(2)                : no
Checking for fdatasync(2)                : yes
Checking for pread(2) and pwrite(2)      : yes
Checking for sendfile(2)                 : no
Checking for sync_file_range(2)          : no
--- libev ---
Checking for header sys/inotify.h        : not found
Checking for header sys/epoll.h          : not found
Checking for header port.h               : not found
Checking for header poll.h               : yes
Checking for function poll               : yes
Checking for header ['sys/types.h', 'sys/event.h'] : not found
Checking for header sys/queue.h                    : yes
Checking for function kqueue                       : not found
Checking for header sys/select.h                   : yes
Checking for function select                       : yes
Checking for header sys/eventfd.h                  : not found
Checking for SYS_clock_gettime                     : no
Checking for library rt                            : yes
Checking for function clock_gettime                : yes
Checking for function nanosleep                    : yes
Checking for function ceil                         : yes
Checking for fdatasync(2) with c++                 : yes
'configure' finished successfully (6.400s)

user ~/node-v0.4.12
$ make
Waf: Entering directory `/home/user/node-v0.4.12/build'
DEST_OS: cygwin
DEST_CPU: x64
Parallel Jobs: 1
Product type: program
[ 3/75] cc: deps/c-ares/ares_strcasecmp.c -> build/default/deps/c-ares/ares_strc                                     asecmp_1.o
/usr/bin/gcc -D_GNU_SOURCE -DHAVE_CONFIG_H=1 -g -O3 -DHAVE_OPENSSL=1 -DEV_FORK_E                                     NABLE=0 -DEV_EMBED_ENABLE=0 -DEV_MULTIPLICITY=0 -DX_STACKSIZE=65536 -D_LARGEFILE                                     _SOURCE -D_FILE_OFFSET_BITS=64 -DEV_MULTIPLICITY=0 -DHAVE_FDATASYNC=1 -DPLATFORM                                     ="cygwin" -D__POSIX__=1 -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -Idefault/deps                                     /c-ares -I../deps/c-ares ../deps/c-ares/ares_strcasecmp.c -c -o default/deps/c-a                                     res/ares_strcasecmp_1.o
../deps/c-ares/ares_strcasecmp.c:18:24: fatal error: ares_setup.h: No such file                                      or directory
 #include "ares_setup.h"
                        ^
compilation terminated.
Waf: Leaving directory `/home/user/node-v0.4.12/build'
Build failed:  -> task failed (err #1):
        {task: cc ares_strcasecmp.c -> ares_strcasecmp_1.o}
Makefile:11: recipe for target 'program' failed
make: *** [program] Error 1

【问题讨论】:

  • 你为什么要构建这么旧的版本?
  • 您可以在 Windows 上轻松构建当前版本。
  • 我更喜欢使用基于 linux 的操作系统 vs cmd.exe。这就是我使用cygwin的原因。 cygwin 不支持比我使用的节点更新的节点版本。
  • 我不知道你希望用这样一个过时且不受支持的 nodejs 版本来完成什么。

标签: node.js cygwin


【解决方案1】:

在 Windows 7 上使用 Cygwin 安装 node-v0.4.12 版本非常困难,因为它已被弃用。

如果您的要求禁止您使用simple installer 在 Windows 上安装最新的 Node,并且您必须使用您提到的非常旧的版本(node-v0.4.12),那么可能更简单的解决方案是在虚拟机上安装该版本装有 Linux 的机器。

【讨论】:

  • 谢谢 - 我认为在 linux 虚拟机上会更容易。我会走那条路。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-31
  • 2011-08-01
  • 1970-01-01
  • 2011-07-20
  • 1970-01-01
相关资源
最近更新 更多