Почему моя среда ломается? Ошибка установки Yarn с sha3

#node.js #npm #yarnpkg

Вопрос:

Проблема

Я пытаюсь клонировать этот проект: https://github.com/Bounties-Network/Explorer .
Когда я запускаю yarn install, все ломается. Я думаю, что это может быть связано с gyp, но я действительно не знаю, как это исправить. Куда вы смотрите, когда получаете такую ошибку?

Ошибки, которые я получаю

 2 warnings and 19 errors generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/victorforissier/.nvm/versions/node/v14.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/Users/victorforissier/.nvm/versions/node/v14.5.0/bin/node" "/Users/victorforissier/.nvm/versions/node/v14.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/victorforissier/dev/Explorer/node_modules/sha3
 

Журналы

 yarn install v1.22.4
warning ../../package.json: No license field
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "@apollo/react-hooks > @apollo/react-common@3.1.2" has unmet peer dependency "apollo-utilities@^1.3.2".
warning " > @storybook/addon-centered@5.2.0-rc.2" has unmet peer dependency "mithril@*".
warning " > @storybook/addon-centered@5.2.0-rc.2" has unmet peer dependency "preact@*".
warning "@types/reflexbox > @emotion/styled@10.0.17" has incorrect peer dependency "@emotion/core@^10.0.17".
warning "@types/reflexbox > @emotion/styled > @emotion/styled-base@10.0.19" has incorrect peer dependency "@emotion/core@^10.0.17".
warning " > sass-extract-loader@1.1.0" has incorrect peer dependency "webpack@^3 || ^2 || ^2.2.0-rc.0 || ^2.1.0-beta || ^1.12.6".
[4/4] 🔨  Building fresh packages...
[6/12] ⠄ scrypt
[8/12] ⠄ fsevents
[9/12] ⠄ fsevents
[4/12] ⠄ sha3
error /Users/victorforissier/dev/Explorer/node_modules/sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/victorforissier/dev/Explorer/node_modules/sha3
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@14.5.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/victorforissier/.nvm/versions/node/v14.5.0/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   '/Users/victorforissier/dev/Explorer/node_modules/sha3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/victorforissier/.nvm/versions/node/v14.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/victorforissier/Library/Caches/node-gyp/14.5.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/victorforissier/.nvm/versions/node/v14.5.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/victorforissier/Library/Caches/node-gyp/14.5.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/victorforissier/dev/Explorer/node_modules/sha3',
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' ]
  CXX(target) Release/obj.target/sha3/src/addon.o
In file included from ../src/addon.cpp:4:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(Boolean)
^~~~~~~~~~
../../nan/nan_converters_43_inl.h:18:23: note: expanded from macro 'X'
      val->To ## TYPE(isolate->GetCurrentContext())                            
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2844:37: note: passing argument to parameter 'isolate' here
  Local<Boolean> ToBoolean(Isolate* isolate) const;
                                    ^
In file included from ../src/addon.cpp:4:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:40:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(bool, Boolean)
^~~~~~~~~~~~~~~~
../../nan/nan_converters_43_inl.h:37:29: note: expanded from macro 'X'
  return val->NAME ## Value(isolate->GetCurrentContext());                     
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2854:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
In file included from ../src/addon.cpp:4:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to 'Local<v8::Context>'
  return scope.Escape(v8::Function::New( isolate
                                         ^~~~~~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:186:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> amp;' for 1st argument
class Local {
      ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:186:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> amp;amp;' for 1st argument
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:190:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>' against 'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:333:22: note: explicit constructor is not a candidate
  explicit V8_INLINE Local(T* that) : val_(that) {}
                     ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:4442:22: note: passing argument to parameter 'context' here
      Local<Context> context, FunctionCallback callback,
                     ^
In file included from ../src/addon.cpp:4:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:37: error: too few arguments to function call, expected 2, have 1
  return v8::StringObject::New(value).As<v8::StringObject>();
         ~~~~~~~~~~~~~~~~~~~~~      ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:5836:23: note: 'New' declared here
  static Local<Value> New(Isolate* isolate, Local<String> value);
                      ^
In file included from ../src/addon.cpp:4:
../../nan/nan.h:1034:53: error: too few arguments to function call, single argument 'context' was not specified
      v8::Local<v8::String> string = from->ToString();
                                     ~~~~~~~~~~~~~~ ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2806:44: note: 'ToString' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
In file included from ../src/addon.cpp:4:
../../nan/nan.h:1044:37: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type 'char *'
        length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
                                    ^~~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3033:26: note: passing argument to parameter 'isolate' here
  int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
                         ^
In file included from ../src/addon.cpp:4:
../../nan/nan.h:1818:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3666:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3669:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../src/addon.cpp:4:
../../nan/nan.h:1824:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(key, value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3666:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3669:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../src/addon.cpp:4:
../../nan/nan.h:1830:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(index, value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3666:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3669:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../src/addon.cpp:4:
../../nan/nan.h:1836:32: error: no matching member function for call to 'Get'
        New(persistentHandle)->Get(New(key).ToLocalChecked()));
        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3713:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3716:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../src/addon.cpp:4:
../../nan/nan.h:1842:48: error: no matching member function for call to 'Get'
    return scope.Escape(New(persistentHandle)->Get(key));
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3713:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3716:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../src/addon.cpp:4:
../../nan/nan.h:1847:48: error: no matching member function for call to 'Get'
    return scope.Escape(New(persistentHandle)->Get(index));
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3713:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:3716:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../src/addon.cpp:4:
In file included from ../../nan/nan.h:2657:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object>'
    assert(persistent().IsNearDeath());
           ~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../src/addon.cpp:4:
In file included from ../../nan/nan.h:2657:
../../nan/nan_object_wrap.h:67:18: error: no member named 'MarkIndependent' in 'Nan::Persistent<v8::Object>'
    persistent().MarkIndependent();
    ~~~~~~~~~~~~ ^
../../nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object>'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../src/addon.cpp:4:
In file included from ../../nan/nan.h:2753:
../../nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
      data   = static_cast<char*>(buffer->GetContents().Data())   byte_offset;
                                          ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:5254:3: note: 'GetContents' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
  ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
In file included from ../src/addon.cpp:9:
In file included from ../src/KeccakNISTInterface.h:17:
../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
#define ALIGN __attribute__ ((aligned(32)))
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note: previous definition is here
#define ALIGN(p)        __DARWIN_ALIGN(p)
        ^
../src/addon.cpp:36:64: error: too few arguments to function call, single argument 'context' was not specified
                hashlen = info[0]->IsUndefined() ? 512 : info[0]->Int32Value();
                                                         ~~~~~~~~~~~~~~~~~~~ ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2865:40: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                       ^
../src/addon.cpp:76:36: error: too few arguments to function call, single argument 'context' was not specified
                constructor.Reset(t->GetFunction());
                                  ~~~~~~~~~~~~~~ ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:6464:46: note: 'GetFunction' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                             ^
../src/addon.cpp:77:77: error: too few arguments to function call, single argument 'context' was not specified
                target->Set(Nan::New<String>("SHA3Hash").ToLocalChecked(), t->GetFunction());
                                                                           ~~~~~~~~~~~~~~ ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:6464:46: note: 'GetFunction' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
                                             ^
../src/addon.cpp:97:49: error: too few arguments to function call, single argument 'context' was not specified
                        Local<Object> buffer_obj = info[0]->ToObject();
                                                   ~~~~~~~~~~~~~~~~~ ^
/Users/victorforissier/Library/Caches/node-gyp/14.5.0/include/node/v8.h:2818:44: note: 'ToObject' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
2 warnings and 19 errors generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/victorforissier/.nvm/versions/node/v14.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/Users/victorforissier/.nvm/versions/node/v14.5.0/bin/node" "/Users/victorforissier/.nvm/versions/node/v14.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/victorforissier/dev/Explorer/node_modules/sha3

 

Ответ №1:

Обновите npm, это должно решить проблему.

     npm i npm -g
 

Комментарии:

1. Я бы хотел:/ но это не сработало … похоже, потому, что пакеты проекта слишком старые. Сдался. Спасибо!