1

我正在尝试将 dredd apiary 测试集成到 Jenkins 中。我按照以下步骤在 Jenkins(Linux 上)上安装 NodeJS、npm 和 dredd: https ://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin

While running the test I got this ERR message: 
npm ERR! Failed at the protagonist@0.8.0 install script.
npm ERR! This is most likely a problem with the protagonist package,
npm ERR! not with npm itself....

你知道这个问题吗?有解决办法吗?完整的日志:

Building in workspace /data/jenkins/jobs/Automatic APIary Test/workspace
Checkout:workspace / /data/jenkins/jobs/Automatic APIary Test/workspace - hudson.remoting.LocalChannel@14e4ed4
Using strategy: Default
Last Built Revision: Revision 367475bec30334f138309b9c28e63e953b773adc (origin/master, origin/HEAD)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision 367475bec30334f138309b9c28e63e953b773adc (origin/master, origin/HEAD)
Checking out Revision 367475bec30334f138309b9c28e63e953b773adc (origin/master, origin/HEAD)
Warning : There are multiple branch changesets here
$ /data/jenkins/tools/nodejs/bin/npm install -g dredd
npm http GET https://registry.npmjs.org/dredd
npm http 304 https://registry.npmjs.org/dredd
npm http GET https://registry.npmjs.org/protagonist
npm http GET https://registry.npmjs.org/uri-template
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/html
npm http GET https://registry.npmjs.org/htmlencode
npm http GET https://registry.npmjs.org/marked
npm http GET https://registry.npmjs.org/advisable
npm http GET https://registry.npmjs.org/proxyquire
npm http GET https://registry.npmjs.org/coffee-script/1.6.3
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/file
npm http GET https://registry.npmjs.org/gavel
npm http GET https://registry.npmjs.org/winston
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/proxyquire
npm http 304 https://registry.npmjs.org/htmlencode
npm http 304 https://registry.npmjs.org/uri-template
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/html
npm http 304 https://registry.npmjs.org/coffee-script/1.6.3
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/winston
npm http 304 https://registry.npmjs.org/advisable
npm http 304 https://registry.npmjs.org/file
npm http 304 https://registry.npmjs.org/marked
npm http 304 https://registry.npmjs.org/protagonist
npm http 304 https://registry.npmjs.org/gavel
npm WARN engine uri-template@0.4.1: wanted: {"node":"~0.10.4"} (current: {"node":"v0.11.12","npm":"1.4.3"})
npm http GET https://registry.npmjs.org/pct-encode
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/minimist
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/stack-trace
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/cycle
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/minimist
npm http 304 https://registry.npmjs.org/pct-encode
npm http 304 https://registry.npmjs.org/eyes
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/stack-trace
npm http 304 https://registry.npmjs.org/pkginfo
npm http 304 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/async/0.2.9
npm http GET https://registry.npmjs.org/commander/2.0.0
npm http GET https://registry.npmjs.org/curl-trace-parser/0.0.7

npm http GET https://registry.npmjs.org/http-string-parser/0.0.4
npm http GET https://registry.npmjs.org/googlediff/0.1.0
npm http GET https://registry.npmjs.org/json-pointer/0.0.4
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/commander/2.0.0
npm http 304 https://registry.npmjs.org/curl-trace-parser/0.0.7
npm http 304 https://registry.npmjs.org/googlediff/0.1.0
npm http 304 https://registry.npmjs.org/async/0.2.9
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/http-string-parser/0.0.4
npm http 304 https://registry.npmjs.org/json-pointer/0.0.4
npm http 304 https://registry.npmjs.org/cycle
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/hawk
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/cookie-jar
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/aws-sign
npm http 304 https://registry.npmjs.org/qs
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"v0.11.12","npm":"1.4.3"})
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/hoek
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"v0.11.12","npm":"1.4.3"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"v0.11.12","npm":"1.4.3"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"v0.11.12","npm":"1.4.3"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"v0.11.12","npm":"1.4.3"})
npm http GET https://registry.npmjs.org/foreach
npm http GET https://registry.npmjs.org/commander/1.2.0
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5

> protagonist@0.8.0 install /data/jenkins/tools/nodejs/lib/node_modules/dredd/node_modules/protagonist
> node-gyp rebuild

make: Entering directory `/data/jenkins/tools/nodejs/lib/node_modules/dredd/node_modules/protagonist/build'
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/HTTP.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/MarkdownBlock.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/MarkdownParser.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/Parser.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/ParserCore.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/Serialize.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/SerializeJSON.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/SerializeYAML.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/snowcrash.o
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/posix/RegexMatch.o
  AR(target) Release/obj.target/snowcrash/snowcrash.a
  COPY Release/snowcrash.a
  CC(target) Release/obj.target/sundown/snowcrash/sundown/src/autolink.o
  CC(target) Release/obj.target/sundown/snowcrash/sundown/src/buffer.o
  CC(target) Release/obj.target/sundown/snowcrash/sundown/html/houdini_href_e.o
  CC(target) Release/obj.target/sundown/snowcrash/sundown/html/houdini_html_e.o
  CC(target) Release/obj.target/sundown/snowcrash/sundown/html/html.o
  CC(target) Release/obj.target/sundown/snowcrash/sundown/html/html_smartypants.o
  CC(target) Release/obj.target/sundown/snowcrash/sundown/src/markdown.o
  CC(target) Release/obj.target/sundown/snowcrash/sundown/src/stack.o
  CC(target) Release/obj.target/sundown/snowcrash/sundown/src/src_map.o
  AR(target) Release/obj.target/snowcrash/sundown.a
  COPY Release/sundown.a
  CXX(target) Release/obj.target/protagonist/src/annotation.o
In file included from ../src/annotation.cc:1:0:
../src/protagonist.h:12:47: error: expected class-name before ‘{’ token
../src/protagonist.h:27:48: error: ‘Arguments’ in namespace ‘v8’ does not name a type
../src/protagonist.h:27:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/protagonist.h:34:54: error: expected class-name before ‘{’ token
../src/protagonist.h:46:48: error: ‘Arguments’ in namespace ‘v8’ does not name a type
../src/protagonist.h:46:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/protagonist.h:53:44: error: expected class-name before ‘{’ token
../src/protagonist.h:67:48: error: ‘Arguments’ in namespace ‘v8’ does not name a type
../src/protagonist.h:67:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/protagonist.h:74:46: error: ‘Arguments’ in namespace ‘v8’ does not name a type
../src/protagonist.h:74:61: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h: In static member function ‘static void protagonist::SourceAnnotation::Init(v8::Handle<v8::Object>)’:
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:768:13: error: ‘v8::HandleScope::HandleScope()’ is private
../src/annotation.cc:19:17: error: within this context
../src/annotation.cc:21:58: error: invalid conversion from ‘v8::Handle<v8::Value> (*)(const int&)’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:3346:34: error:   initialising argument 1 of ‘static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)’ [-fpermissive]
../src/annotation.cc:25:61: error: no matching function for call to ‘v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >::New(v8::Local<v8::Function>)’
../src/annotation.cc:25:61: note: candidate is:
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:5591:4: note: static T* v8::Persistent<T, M>::New(v8::Isolate*, T*) [with T = v8::Function, M = v8::NonCopyablePersistentTraits<v8::Function>]
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:5591:4: note:   candidate expects 2 arguments, 1 provided
../src/annotation.cc:26:68: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >&)’
../src/annotation.cc:26:68: note: candidates are:
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:2057:8: note: bool v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>, v8::PropertyAttribute)
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:2057:8: note:   no known conversion for argument 2 from ‘v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >’ to ‘v8::Handle<v8::Value>’
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:2061:8: note: bool v8::Object::Set(uint32_t, v8::Handle<v8::Value>)
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:2061:8: note:   no known conversion for argument 1 from ‘v8::Local<v8::String>’ to ‘uint32_t {aka unsigned int}’
../src/annotation.cc: At global scope:
../src/annotation.cc:29:43: error: ‘Arguments’ does not name a type
../src/annotation.cc:29:54: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> protagonist::SourceAnnotation::New(const int&)’:
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:768:13: error: ‘v8::HandleScope::HandleScope()’ is private
../src/annotation.cc:31:17: error: within this context
../src/annotation.cc:33:17: error: ‘class protagonist::SourceAnnotation’ has no member named ‘Wrap’
../src/annotation.cc:33:27: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/annotation.cc:34:29: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> protagonist::SourceAnnotation::NewInstance()’:
/home/jboss/.node-gyp/0.11.12/deps/v8/include/v8.h:768:13: error: ‘v8::HandleScope::HandleScope()’ is private
../src/annotation.cc:39:17: error: within this context
../src/annotation.cc:40:41: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >’
../src/annotation.cc: In static member function ‘static v8::Local<v8::Object> protagonist::SourceAnnotation::WrapSourceAnnotation(const snowcrash::SourceAnnotation&)’:
../src/annotation.cc:55:47: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >’
../src/annotation.cc: In static member function ‘static v8::Handle<v8::Value> protagonist::SourceAnnotation::New(const int&)’:
../src/annotation.cc:35:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [Release/obj.target/protagonist/src/annotation.o] Error 1
make: Leaving directory `/data/jenkins/tools/nodejs/lib/node_modules/dredd/node_modules/protagonist/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/data/jenkins/tools/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:107:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1045:12)
gyp ERR! System Linux 3.5.0-47-generic
gyp ERR! command "node" "/data/jenkins/tools/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/jenkins/tools/nodejs/lib/node_modules/dredd/node_modules/protagonist
gyp ERR! node -v v0.11.12
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm http 304 https://registry.npmjs.org/foreach
npm http 304 https://registry.npmjs.org/commander/1.2.0
npm http GET https://registry.npmjs.org/keypress
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/keypress
npm ERR! protagonist@0.8.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the protagonist@0.8.0 install script.
npm ERR! This is most likely a problem with the protagonist package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls protagonist
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.5.0-47-generic
npm ERR! command "/data/jenkins/tools/nodejs/bin/node" "/data/jenkins/tools/nodejs/bin/npm" "install" "-g" "dredd"
npm ERR! cwd /home/jboss/apache-tomcat-7.0.37/apache-tomcat-7.0.37/bin
npm ERR! node -v v0.11.12
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/jboss/apache-tomcat-7.0.37/apache-tomcat-7.0.37/bin/npm-debug.log
npm ERR! not ok code 0
[workspace] $ /bin/sh -xe /home/jboss/tomcat/temp/hudson2769499651973706313.sh
+ echo /usr/lib/jvm/java-1.7.0-openjdk-i386/bin:/data/jenkins/tools/nodejs/bin:/usr/lib/jvm/java-1.7.0-openjdk-i386/bin:/home/jboss/glassfish/glassfish3/bin:/home/jboss/apache-maven-3.0.4/bin:/home/jboss/sonar-runner-2.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
/usr/lib/jvm/java-1.7.0-openjdk-i386/bin:/data/jenkins/tools/nodejs/bin:/usr/lib/jvm/java-1.7.0-openjdk-i386/bin:/home/jboss/glassfish/glassfish3/bin:/home/jboss/apache-maven-3.0.4/bin:/home/jboss/sonar-runner-2.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+ node --version
v0.11.12
+ dredd --version
/home/jboss/tomcat/temp/hudson2769499651973706313.sh: 4: /home/jboss/tomcat/temp/hudson2769499651973706313.sh: dredd: not found
Build step 'Execute shell' marked build as failure
Sending e-mails to: xx
Finished: FAILURE

gcc -v 输出:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
4

1 回答 1

1

看起来 node.js v0.11.x 中有一个 API 更改。我可以在带有节点 v0.11.12 的 Ubuntu Precise / GCC4.6 上重现它。

节点 v0.10.21 似乎工作正常。你确定吗?

注意我创建了一个问题,您可以在https://github.com/apiaryio/protagonist/issues/16跟踪它

于 2014-04-14T12:46:11.370 回答