yarn install
在我的项目上突然失败。我已经尝试将Node降级到12.14。甚至我的Linux内核,在docker中使用node alpine,也可以确保我拥有gcc但没有任何作用:
yarn install v1.22.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > eslint-plugin-prettier@3.1.2" has unmet peer dependency "prettier@>= 1.13.0".
[5/5] Building fresh packages...
[6/9] ⠂ protagonist
[-/9] ⠂ waiting...
[-/9] ⠂ waiting...
[-/9] ⠂ waiting...
warning Error running install script for optional dependency: "/project_folder/node_modules/protagonist: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /project_folder/node_modules/protagonist
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@12.14.1 | linux | x64
gyp info find Python using Python version 3.8.3 found at \"/usr/bin/python\"
gyp http GET https://nodejs.org/download/release/v12.14.1/node-v12.14.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v12.14.1/node-v12.14.1-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v12.14.1/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v12.14.1/SHASUMS256.txt
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args '/home/jiewmeng/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/project_folder/node_modules/protagonist/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/project_folder/node_modules/protagonist/common.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/jiewmeng/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/jiewmeng/.cache/node-gyp/12.14.1',
gyp info spawn args '-Dnode_gyp_dir=/home/jiewmeng/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/jiewmeng/.cache/node-gyp/12.14.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/project_folder/node_modules/protagonist',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/project_folder/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]
1446 | 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’
1449 | 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]
1660 | 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]
2190 | 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’
2193 | *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]
2619 | 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’
2622 | 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]
51 | 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’
54 | 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]
145 | 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’
149 | 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]
175 | 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’
179 | 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
In file included from ../src/protagonist.h:6,
from ../src/annotation.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:7: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
2298 | , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/annotation.cc:1:
../src/protagonist.h: At global scope:
../src/protagonist.h:22:43: error: ‘Handle’ is not a member of ‘v8’
22 | OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
| ^~~~~~
../src/protagonist.h:22:60: error: expected primary-expression before ‘>’ token
22 | OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
| ^
../src/protagonist.h:22:61: error: expected primary-expression before ‘,’ token
22 | OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
| ^
../src/protagonist.h:22:63: error: expected primary-expression before ‘bool’
22 | OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
| ^~~~
../src/protagonist.h:22:67: error: expression list treated as compound expression in initializer [-fpermissive]
22 | OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
| ^
../src/protagonist.h:29:30: error: ‘v8::Handle’ has not been declared
29 | static void Init(v8::Handle<v8::Object> target);
| ^~~~~~
../src/protagonist.h:29:36: error: expected ‘,’ or ‘...’ before ‘<’ token
29 | static void Init(v8::Handle<v8::Object> target);
| ^
../src/protagonist.h:47:30: error: ‘v8::Handle’ has not been declared
47 | static void Init(v8::Handle<v8::Object> target);
| ^~~~~~
../src/protagonist.h:47:36: error: expected ‘,’ or ‘...’ before ‘<’ token
47 | static void Init(v8::Handle<v8::Object> target);
| ^
../src/protagonist.h:68:30: error: ‘v8::Handle’ has not been declared
68 | static void Init(v8::Handle<v8::Object> target);
| ^~~~~~
../src/protagonist.h:68:36: error: expected ‘,’ or ‘...’ before ‘<’ token
68 | static void Init(v8::Handle<v8::Object> target);
| ^
../src/annotation.cc:18:6: error: variable or field ‘Init’ declared void
18 | void SourceAnnotation::Init(Handle<Object> exports)
| ^~~~~~~~~~~~~~~~
../src/annotation.cc:18:29: error: ‘Handle’ was not declared in this scope
18 | void SourceAnnotation::Init(Handle<Object> exports)
| ^~~~~~
../src/annotation.cc:18:42: error: expected primary-expression before ‘>’ token
18 | void SourceAnnotation::Init(Handle<Object> exports)
| ^
../src/annotation.cc:18:44: error: ‘exports’ was not declared in this scope
18 | void SourceAnnotation::Init(Handle<Object> exports)
| ^~~~~~~
../src/annotation.cc: In static member function ‘static v8::Local<v8::Object> protagonist::SourceAnnotation::WrapSourceAnnotation(const snowcrash::SourceAnnotation&)’:
../src/annotation.cc:44:48: error: no matching function for call to ‘v8::Value::ToObject()’
44 | return v8_wrap(annotationObject)->ToObject();
| ^
In file included from /home/jiewmeng/.cache/node-gyp/12.14.1/include/node/node.h:63,
from ../src/protagonist.h:4,
from ../src/annotation.cc:1:
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h:2576:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
2576 | V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
| ^~~~~~~~
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h:2576:44: note: candidate expects 1 argument, 0 provided
In file included from /home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8-internal.h:14,
from /home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h:25,
from /home/jiewmeng/.cache/node-gyp/12.14.1/include/node/node.h:63,
from ../src/protagonist.h:4,
from ../src/annotation.cc:1:
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h:2590:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
2590 | Local<Object> ToObject(Isolate* isolate) const);
| ^~~~~~~~
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
311 | declarator __attribute__((deprecated(message)))
| ^~~~~~~~~~
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h:2590:31: note: candidate expects 1 argument, 0 provided
2590 | Local<Object> ToObject(Isolate* isolate) const);
| ^~~~~~~~
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
311 | declarator __attribute__((deprecated(message)))
| ^~~~~~~~~~
In file included from /home/jiewmeng/.cache/node-gyp/12.14.1/include/node/node.h:63,
from ../src/protagonist.h:4,
from ../src/annotation.cc:1:
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/node_object_wrap.h:84:78: required from here
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
10004 | reinterpret_cast<Callback>(callback), type);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61: required from here
/home/jiewmeng/.cache/node-gyp/12.14.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [protagonist.target.mk:163: Release/obj.target/protagonist/src/annotation.o] Error 1
make: Leaving directory '/project_folder/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/jiewmeng/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.4.44-1-MANJARO
gyp ERR! command \"/home/jiewmeng/.nvm/versions/node/v12.14.1/bin/node\" \"/home/jiewmeng/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /project_folder/node_modules/protagonist
Done in 84.45s.
有人可以指出我正确的方向吗?