构建上下文失败并出现错误:字段'time'的类型不完整

时间:2014-03-06 08:08:01

标签: node.js jsdom contextify

后台:我正在使用jquery来测试nodeunit的JavaScript代码(使用jQuery对象)。对于jquery,我需要jsdom来提供window对象。构建jsdom失败是因为它需要contextify,它不构建在64位Debian上。我在Linux Mint上测试了它,包括标准的Ubuntu和Debian版本,结果相同。

问题: node.js在两种情况下都是0.11.11-release,并且是从git存储库构建的。构建时,timeit_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)

1 个答案:

答案 0 :(得分:0)

我已经建议将此作为评论,但我也会在此处将其作为答案发布。

使用不稳定版本的软件可能很危险。通常,库配置为使用过去和当前版本,但不总是未来版本。尤其是不断变化的未来版本。 0.11可能会淘汰或更改您的库所期望的一些0.10功能。