我在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
答案 0 :(得分:1)
在Windows 7上安装带有Cygwin的node-v0.4.12版本将非常困难,因为它已被弃用。
如果您的要求禁止使用simple installer在Windows上安装最新的节点,并且您必须使用您提到的非常旧的版本(node-v0.4.12),则可能更容易安装该版本的解决方案在使用Linux的虚拟机上。