背景:我jquery
用来测试 JavaScript 代码(使用 jQuery 对象)nodeunit
。对于 jquery,我需要jsdom
提供一个window
对象。构建 jsdom 失败,因为它需要contextify
,它不是在 64 位 Debian 上构建的。我在标准 Ubuntu 和 Debian 版本的 Linux Mint 上对其进行了测试,结果相同。
问题: node.js 在这两种情况下都是 0.11.11-release,并且是从 git 存储库构建的。在构建时time
,it_interval
、 和更多是不完整的。为什么?
完整的构建日志在这里: http: //pastebin.com/iTq75435它以:
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings
> contextify@0.1.6 install /tmp/node_modules/contextify
> node-gyp rebuild
make: Entering directory `/tmp/node_modules/contextify/build'
CXX(target) Release/obj.target/contextify/src/contextify.o
In file included from /home/sie/.node-gyp/0.11.11/src/node.h:61:0,
from ../src/contextify.cc:1:
/home/sie/.node-gyp/0.11.11/deps/v8/include/v8.h: In member function ‘void v8::ReturnValue<T>::Set(uint32_t)’:
/home/sie/.node-gyp/0.11.11/deps/v8/include/v8.h:5816:31: warning: typedef ‘I’ locally defined but not used [-Wunused-local-typedefs]
typedef internal::Internals I;
^
In file included from /usr/include/x86_64-linux-gnu/bits/time.h:86:0,
from /usr/include/time.h:41,
from /usr/include/pthread.h:24,
from /usr/include/x86_64-linux-gnu/c++/4.8/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/4.8/bits/gthr.h:148,
from /usr/include/c++/4.8/ext/atomicity.h:35,
from /usr/include/c++/4.8/bits/basic_string.h:39,
from /usr/include/c++/4.8/string:52,
from ../src/contextify.cc:3:
/usr/include/x86_64-linux-gnu/bits/timex.h: At global scope:
/usr/include/x86_64-linux-gnu/bits/timex.h:36:18: error: field ‘time’ has incomplete type
struct timeval time; /* (read only) */
^
In file included from /usr/include/pthread.h:24:0,
from /usr/include/x86_64-linux-gnu/c++/4.8/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/4.8/bits/gthr.h:148,
from /usr/include/c++/4.8/ext/atomicity.h:35,
from /usr/include/c++/4.8/bits/basic_string.h:39,
from /usr/include/c++/4.8/string:52,
from ../src/contextify.cc:3:
/usr/include/time.h:163:21: error: field ‘it_interval’ has incomplete type
struct timespec it_interval;
^
/usr/include/time.h:164:21: error: field ‘it_value’ has incomplete type
struct timespec it_value;
^
/usr/include/time.h:189:8: error: ‘clock_t’ does not name a type
extern clock_t clock (void) __THROW;
^
/usr/include/time.h:192:8: error: ‘time_t’ does not name a type
extern time_t time (time_t *__timer) __THROW;
^
/usr/include/time.h:195:25: error: ‘time_t’ was not declared in this scope
extern double difftime (time_t __time1, time_t __time0)