Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

npm install -g dredd, Error: make failed with exit code: 2 #1113

Closed
travis5491811 opened this issue Sep 25, 2018 · 6 comments
Closed

npm install -g dredd, Error: make failed with exit code: 2 #1113

travis5491811 opened this issue Sep 25, 2018 · 6 comments

Comments

@travis5491811
Copy link

Describe your problem

I found dredd and was excited to try it out to test my OpenAPI .yml file with dredd api-description.yml http://127.0.0.1:3000. But i didn't get that far. When I ran npm install -g dredd on my Linux machine, I ran into issues.

System

Operating System: Linux Mint 19
Kernel: Linux 4.15.0-34-generic
Architecture: x86-64
node v10.11.0 (npm v6.4.1)

What command line options do you use?

$ npm install -g dredd

Result

$ npm install -g dredd
npm WARN deprecated [email protected]: Broken not support
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
/home/travis/.nvm/versions/node/v10.11.0/bin/dredd -> /home/travis/.nvm/versions/node/v10.11.0/lib/node_modules/dredd/bin/dredd

> [email protected] install /home/travis/.nvm/versions/node/v10.11.0/lib/node_modules/dredd/node_modules/protagonist
> node-gyp rebuild

make: Entering directory '/home/travis/.nvm/versions/node/v10.11.0/lib/node_modules/dredd/node_modules/protagonist/build'
  CXX(target) Release/obj.target/libmarkdownparser/drafter/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.o
  CXX(target) Release/obj.target/libmarkdownparser/drafter/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.o
  CXX(target) Release/obj.target/libmarkdownparser/drafter/ext/snowcrash/ext/markdown-parser/src/MarkdownParser.o
  AR(target) Release/obj.target/drafter/ext/snowcrash/markdownparser.a
  COPY Release/markdownparser.a
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/HTTP.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/MSON.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/MSONOneOfParser.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/MSONSourcemap.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/MSONTypeSectionParser.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/MSONValueMemberParser.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/Blueprint.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/BlueprintSourcemap.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/Section.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/Signature.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/snowcrash.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/UriTemplateParser.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/HeadersParser.o
  CXX(target) Release/obj.target/libsnowcrash/drafter/ext/snowcrash/src/posix/RegexMatch.o
  AR(target) Release/obj.target/drafter/ext/snowcrash/snowcrash.a
  COPY Release/snowcrash.a
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/autolink.o
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/buffer.o
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.o
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c: In function ‘parse_blockquote’:
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c:1446:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (block_map)
     ^~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c:1449:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  if (rndr->cb.blockquote)
  ^~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c: In function ‘parse_listitem’:
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c:1660:20: warning: variable ‘has_inside_empty’ set but not used [-Wunused-but-set-variable]
  int in_empty = 0, has_inside_empty = 0, in_fence = 0;
                    ^~~~~~~~~~~~~~~~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c: In function ‘parse_table_header’:
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c:2190:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (pipes < 0)
     ^~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c:2193:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  *columns = pipes + 1;
  ^
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c: In function ‘sd_markdown_render’:
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c:2619:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
     else
     ^~~~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c:2622:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
  text = bufnew(64);
  ^~~~
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.o
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c: In function ‘src_map_release’:
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c:51:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (!map)
     ^~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c:54:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  for (i = 0; i < (size_t)map->asize; ++i) {
  ^~~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c: In function ‘src_map_location’:
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c:145:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (!map ||
     ^~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c:149:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  for (i = 0; i < (size_t)map->size; ++i) {
  ^~~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c: In function ‘src_map_new_tail’:
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c:175:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (!map ||
     ^~
../drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c:179:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  for (i = 0; i < (size_t)map->size; ++i) {
  ^~~
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/stack.o
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_href_e.o
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_html_e.o
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/html.o
  CC(target) Release/obj.target/libsundown/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/html_smartypants.o
  AR(target) Release/obj.target/drafter/ext/snowcrash/sundown.a
  COPY Release/sundown.a
  CXX(target) Release/obj.target/libdrafter/drafter/src/drafter.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/drafter_private.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/Serialize.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/SerializeAST.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/SerializeSourcemap.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/SerializeResult.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/RefractAPI.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/RefractDataStructure.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/RefractSourceMap.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/Render.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/NamedTypesRegistry.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/RefractElementFactory.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/ConversionContext.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/Element.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/VisitorUtils.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/SerializeCompactVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/SerializeVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/ComparableVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/TypeQueryVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/IsExpandableVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/ExpandVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/RenderJSONVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/PrintVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/JSONSchemaVisitor.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/Registry.o
  CXX(target) Release/obj.target/libdrafter/drafter/src/refract/Query.o
  AR(target) Release/obj.target/drafter/drafter.a
  COPY Release/drafter.a
  CXX(target) Release/obj.target/libsos/drafter/ext/sos/src/sos.o
  AR(target) Release/obj.target/drafter/sos.a
  COPY Release/sos.a
  CXX(target) Release/obj.target/protagonist/src/annotation.o
  CXX(target) Release/obj.target/protagonist/src/options_parser.o
../src/options_parser.cc: In function ‘protagonist::OptionsResult* protagonist::ParseOptionsObject(v8::Handle<v8::Object>, bool)’:
../src/options_parser.cc:30:43: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
         const String::Utf8Value strKey(key);
                                           ^
In file included from /home/travis/.node-gyp/10.11.0/include/node/v8.h:26:0,
                 from /home/travis/.node-gyp/10.11.0/include/node/node.h:63,
                 from ../src/protagonist.h:4,
                 from ../src/options_parser.cc:1:
/home/travis/.node-gyp/10.11.0/include/node/v8.h:2888:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/travis/.node-gyp/10.11.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/options_parser.cc:49:55: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
                 const String::Utf8Value strValue(value);
                                                       ^
In file included from /home/travis/.node-gyp/10.11.0/include/node/v8.h:26:0,
                 from /home/travis/.node-gyp/10.11.0/include/node/node.h:63,
                 from ../src/protagonist.h:4,
                 from ../src/options_parser.cc:1:
/home/travis/.node-gyp/10.11.0/include/node/v8.h:2888:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/travis/.node-gyp/10.11.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
  CXX(target) Release/obj.target/protagonist/src/parse_async.o
../src/parse_async.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE protagonist::Parse(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/parse_async.cc:61:53: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
     String::Utf8Value sourceData(info[0]->ToString());
                                                     ^
In file included from /home/travis/.node-gyp/10.11.0/include/node/v8.h:26:0,
                 from /home/travis/.node-gyp/10.11.0/include/node/node.h:63,
                 from ../src/v8_wrapper.h:4,
                 from ../src/parse_async.cc:3:
/home/travis/.node-gyp/10.11.0/include/node/v8.h:2888:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/home/travis/.node-gyp/10.11.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/parse_async.cc: In function ‘void AsyncParseAfter(uv_work_t*)’:
../src/parse_async.cc:128:14: error: no matching function for call to ‘v8::TryCatch::TryCatch()’
     TryCatch try_catch;
              ^~~~~~~~~
In file included from /home/travis/.node-gyp/10.11.0/include/node/node.h:63:0,
                 from ../src/v8_wrapper.h:4,
                 from ../src/parse_async.cc:3:
/home/travis/.node-gyp/10.11.0/include/node/v8.h:8530:12: note: candidate: v8::TryCatch::TryCatch(v8::Isolate*)
   explicit TryCatch(Isolate* isolate);
            ^~~~~~~~
/home/travis/.node-gyp/10.11.0/include/node/v8.h:8530:12: note:   candidate expects 1 argument, 0 provided
../src/parse_async.cc:133:39: warning: ‘void node::FatalException(const v8::TryCatch&)’ is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
         node::FatalException(try_catch);
                                       ^
In file included from ../src/v8_wrapper.h:4:0,
                 from ../src/parse_async.cc:3:
/home/travis/.node-gyp/10.11.0/include/node/node.h:420:29: note: declared here
                 inline void FatalException(const v8::TryCatch& try_catch) {
                             ^
/home/travis/.node-gyp/10.11.0/include/node/node.h:91:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
protagonist.target.mk:155: recipe for target 'Release/obj.target/protagonist/src/parse_async.o' failed
make: *** [Release/obj.target/protagonist/src/parse_async.o] Error 1
make: Leaving directory '/home/travis/.nvm/versions/node/v10.11.0/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 (/home/travis/.nvm/versions/node/v10.11.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.15.0-34-generic
gyp ERR! command "/home/travis/.nvm/versions/node/v10.11.0/bin/node" "/home/travis/.nvm/versions/node/v10.11.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/travis/.nvm/versions/node/v10.11.0/lib/node_modules/dredd/node_modules/protagonist
gyp ERR! node -v v10.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

> [email protected] postinstall /home/travis/.nvm/versions/node/v10.11.0/lib/node_modules/dredd/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/dredd/node_modules/protagonist):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
added 248 packages from 260 contributors in 89.883s

What's your dredd --version output?

dredd v5.2.0 (Linux 4.15.0-34-generic; x64)

Can you send us failing test in a Pull Request?

I'm not sure how. This problem appears to be an issue with dredd being dependent on a specific setup (windows, mac, or maybe an exact version of node...i don't know). I've never had an issue where npm install x didn't work for me but worked for everyone else (with one exception, some npm packages required assistance from apt install build-essential but that is already installed on my machine)

Not sure if problem is due to dredd having unsupported packages [email protected]: Broken not support npm WARN deprecated [email protected]: Package no longer supported

@kylef
Copy link
Member

kylef commented Sep 25, 2018

@travis5491811 It does look like Dredd has been successfully installed. An optional dependency has not been installed however. This doesn't affect the functionality of Dredd. The important lines are near the bottom of your output:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/dredd/node_modules/protagonist):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
added 248 packages from 260 contributors in 89.883s

Protagonist cannot be installed because the last stable release does not support Node 10.

@travis5491811
Copy link
Author

@kylef When i try to run it, i get the following:

$ dredd test/integration_test/openapi/openapi_full.yml http://127.0.0.1:3051
warn: Parser warning in file 'test/integration_test/openapi/openapi_full.yml': 
Could not recognize API description format.
Falling back to API Blueprint by default.
 on line 1
warn: Parser warning in file 'test/integration_test/openapi/openapi_full.yml': ignoring possible metadata, expected '<key> : <value>', one one per line on line 1
warn: Parser warning in file 'test/integration_test/openapi/openapi_full.yml': expected API name, e.g. '# <API Name>' on line 1
info: Beginning Dredd testing...
complete: Tests took 1ms

This is for a OpenAPI 3.0.1 file that successfully works in swagger-ui and passes swagger-cli validate. Does it support OpenAPI 3.x?

@kylef
Copy link
Member

kylef commented Sep 25, 2018

@travis5491811 OpenAPI 3 is not currently supported in Dredd. We are working on support in the future though but cannot provide a timeframe at the moment.

@honzajavorek
Copy link
Contributor

@kylef's right. There is an issue for that: #894 Please, vote it up - it helps us to prioritize our work.

The previous issue you had is a duplicate of #659, basically. We need to give people more clues on what happened, these errors are not cool.

@travis5491811
Copy link
Author

Thanks @kylef , @honzajavorek for looking into it.

@honzajavorek
Copy link
Contributor

@travis5491811 You're welcome! Thank you for trying to use Dredd and for filing the issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants