npm 配置问题和安装 ganache-cli 和松露的错误

Posted

技术标签:

【中文标题】npm 配置问题和安装 ganache-cli 和松露的错误【英文标题】:Issues with npm config & errors installing ganache-cli and truffle 【发布时间】:2020-03-19 16:34:45 【问题描述】:

我想使用 npm 安装 ganache-cli 和 truffle,但遇到两种类型的错误(请参阅下面粘贴的代码)。

    npm 配置

如果我运行命令 npm config,我会收到以下错误。这可能是2.中错误的原因吗?

:~ john$ npm 配置
npm 错误!用法:
npm 错误! npm 配置集
npm 错误! npm 配置获取 []
npm 错误! npm 配置删除
npm 错误! npm 配置列表 [--json]
npm 错误! npm 配置编辑
npm 错误! npm 集
npm 错误! npm 获取 []
npm 错误!
npm 错误!别名:
    npm install -g ganache-cli

当我安装 ganache-cli 模块时,我收到以下错误:

john$ npm uninstall -g ganache-cli && npm install -g ganache-cli
0.036 秒内更新
/Users/john/.npm-global/bin/ganache-cli -> /Users/john/.npm-global/lib/node_modules/ganache-cli/cli.js

keccak@1.4.0 安装 /Users/john/.npm-global/lib/node_modules/ganache-cli/node_modules/keccak npm 运行重建 || echo "Keccak 绑定编译失败。将使用纯 JS 实现。"

keccak@1.4.0 重建 /Users/john/.npm-global/lib/node_modules/ganache-cli/node_modules/keccak 节点gyp重建

CXX(target) 发布/obj.target/keccak/src/addon.o ../src/addon.cc:37:47:错误:函数调用的参数太少,未指定单个参数“上下文” unsigned int rate = info[0]->IntegerValue();

/Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8.h:2609:3: note: 'IntegerValue' declared here V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue( ^ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8config.h:351:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT' #define V8_WARN_UNUSED_RESULT attribute((warn_unused_result)) ^ ../src/addon.cc:38:51: error: too few arguments to function call, single argument 'context' was not specified unsigned int capacity = info[1]->IntegerValue(); ~~~~~~~~~~~~~~~~~~~~~ ^ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8.h:2609:3: note: 'IntegerValue' declared here V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue( ^ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8config.h:351:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT' #define V8_WARN_UNUSED_RESULT attribute((warn_unused_result)) ^ ../src/addon.cc:56:48: error: too few arguments to function call, single argument 'context' was not specified unsigned char bits = info[0]->IntegerValue(); ~~~~~~~~~~~~~~~~~~~~~ ^ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8.h:2609:3: note: 'IntegerValue' declared here V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue( ^ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8config.h:351:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT' #define V8_WARN_UNUSED_RESULT attribute((warn_unused_result)) ^ ../src/addon.cc:64:43: error: too few arguments to function call, single argument 'context' was not specified size_t length = info[0]->IntegerValue(); ~~~~~~~~~~~~~~~~~~~~~ ^ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8.h:2609:3: note: 'IntegerValue' declared here V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue( ^ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8config.h:351:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT' #define V8_WARN_UNUSED_RESULT attribute((warn_unused_result)) ^ ../src/addon.cc:75:73: error: no matching member function for call to 'ToObject' KeccakWrapper* to = Nan::ObjectWrap::Unwrap(info[0]->ToObject()); ~~~~~~~~~^~~~~~~~ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8.h:2576:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided V8_WARN_UNUSED_RESULT MaybeLocal ToObject( ^ /Users/john/Library/Caches/node-gyp/12.13.1/include/node/v8.h:2590:31: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided Local ToObject(Isolate* isolate) const); ^ 5 errors generated. make: *** [Release/obj.target/keccak/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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:210:5) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Darwin 19.0.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/john/.npm-global/lib/node_modules/ganache-cli/node_modules/keccak gyp ERR! node -v v12.13.1 gyp ERR! node-gyp -v v5.0.5 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! keccak@1.4.0 rebuild: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the keccak@1.4.0 rebuild script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/john/.npm/_logs/2019-11-24T01_36_55_029Z-debug.log Keccak bindings compilation fail. Pure JS implementation will be used. secp256k1@3.7.1 install /Users/john/.npm-global/lib/node_modules/ganache-cli/node_modules/secp256k1 npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used." secp256k1@3.7.1 rebuild /Users/john/.npm-global/lib/node_modules/ganache-cli/node_modules/secp256k1 node-gyp rebuild CXX(target) Release/obj.target/secp256k1/src/addon.o CXX(target) Release/obj.target/secp256k1/src/privatekey.o ../src/privatekey.cc:73:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] secp256k1_ec_privkey_negate(secp256k1ctx, &private_key[0]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../src/privatekey.cc:4: In file included from ../src/secp256k1-src/src/scalar_impl.h:10: In file included from ../src/secp256k1-src/src/group.h:11: ../src/secp256k1-src/src/field.h:36:13: warning: unused function 'secp256k1_fe_normalize' [-Wunused-function] static void secp256k1_fe_normalize(secp256k1_fe *r); ^ ../src/secp256k1-src/src/field.h:39:13: warning: unused function 'secp256k1_fe_normalize_weak' [-Wunused-function] static void secp256k1_fe_normalize_weak(secp256k1_fe *r); ^ ../src/secp256k1-src/src/field.h:42:13: warning: unused function 'secp256k1_fe_normalize_var' [-Wunused-function] static void secp256k1_fe_normalize_var(secp256k1_fe *r); ^ ../src/secp256k1-src/src/field.h:46:12: warning: unused function 'secp256k1_fe_normalizes_to_zero' [-Wunused-function] static int secp256k1_fe_normalizes_to_zero(secp256k1_fe *r); ^ ../src/secp256k1-src/src/field.h:50:12: warning: unused function 'secp256k1_fe_normalizes_to_zero_var' [-Wunused-function] static int secp256k1_fe_normalizes_to_zero_var(secp256k1_fe *r); ^ ../src/secp256k1-src/src/field.h:53:13: warning: unused function 'secp256k1_fe_set_int' [-Wunused-function] static void secp256k1_fe_set_int(secp256k1_fe *r, int a); ^ ../src/secp256k1-src/src/field.h:56:13: warning: unused function 'secp256k1_fe_clear' [-Wunused-function] static void secp256k1_fe_clear(secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:59:12: warning: unused function 'secp256k1_fe_is_zero' [-Wunused-function] static int secp256k1_fe_is_zero(const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:62:12: warning: unused function 'secp256k1_fe_is_odd' [-Wunused-function] static int secp256k1_fe_is_odd(const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:65:12: warning: unused function 'secp256k1_fe_equal' [-Wunused-function] static int secp256k1_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b); ^ ../src/secp256k1-src/src/field.h:68:12: warning: unused function 'secp256k1_fe_equal_var' [-Wunused-function] static int secp256k1_fe_equal_var(const secp256k1_fe *a, const secp256k1_fe *b); ^ ../src/secp256k1-src/src/field.h:71:12: warning: unused function 'secp256k1_fe_cmp_var' [-Wunused-function] static int secp256k1_fe_cmp_var(const secp256k1_fe *a, const secp256k1_fe *b); ^ ../src/secp256k1-src/src/field.h:74:12: warning: unused function 'secp256k1_fe_set_b32' [-Wunused-function] static int secp256k1_fe_set_b32(secp256k1_fe *r, const unsigned char *a); ^ ../src/secp256k1-src/src/field.h:77:13: warning: unused function 'secp256k1_fe_get_b32' [-Wunused-function] static void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:81:13: warning: unused function 'secp256k1_fe_negate' [-Wunused-function] static void secp256k1_fe_negate(secp256k1_fe *r, const secp256k1_fe *a, int m); ^ ../src/secp256k1-src/src/field.h:85:13: warning: unused function 'secp256k1_fe_mul_int' [-Wunused-function] static void secp256k1_fe_mul_int(secp256k1_fe *r, int a); ^ ../src/secp256k1-src/src/field.h:88:13: warning: unused function 'secp256k1_fe_add' [-Wunused-function] static void secp256k1_fe_add(secp256k1_fe *r, const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:92:13: warning: unused function 'secp256k1_fe_mul' [-Wunused-function] static void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b); ^ ../src/secp256k1-src/src/field.h:96:13: warning: unused function 'secp256k1_fe_sqr' [-Wunused-function] static void secp256k1_fe_sqr(secp256k1_fe *r, const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:103:12: warning: unused function 'secp256k1_fe_sqrt' [-Wunused-function] static int secp256k1_fe_sqrt(secp256k1_fe *r, const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:106:12: warning: unused function 'secp256k1_fe_is_quad_var' [-Wunused-function] static int secp256k1_fe_is_quad_var(const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:110:13: warning: unused function 'secp256k1_fe_inv' [-Wunused-function] static void secp256k1_fe_inv(secp256k1_fe *r, const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:113:13: warning: unused function 'secp256k1_fe_inv_var' [-Wunused-function] static void secp256k1_fe_inv_var(secp256k1_fe *r, const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:118:13: warning: unused function 'secp256k1_fe_inv_all_var' [-Wunused-function] static void secp256k1_fe_inv_all_var(secp256k1_fe *r, const secp256k1_fe *a, size_t len); ^ ../src/secp256k1-src/src/field.h:121:13: warning: unused function 'secp256k1_fe_to_storage' [-Wunused-function] static void secp256k1_fe_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a); ^ ../src/secp256k1-src/src/field.h:124:13: warning: unused function 'secp256k1_fe_from_storage' [-Wunused-function] static void secp256k1_fe_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a); ^ ../src/secp256k1-src/src/field.h:127:13: warning: unused function 'secp256k1_fe_storage_cmov' [-Wunused-function] static void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag); ^ ../src/secp256k1-src/src/field.h:130:13: warning: unused function 'secp256k1_fe_cmov' [-Wunused-function] static void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag); ^ In file included from ../src/privatekey.cc:4: In file included from ../src/secp256k1-src/src/scalar_impl.h:10: ../src/secp256k1-src/src/group.h:44:13: warning: unused function 'secp256k1_ge_set_xy' [-Wunused-function] static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y); ^ ../src/secp256k1-src/src/group.h:50:12: warning: unused function 'secp256k1_ge_set_xquad' [-Wunused-function] static int secp256k1_ge_set_xquad(secp256k1_ge *r, const secp256k1_fe *x); ^ ../src/secp256k1-src/src/group.h:54:12: warning: unused function 'secp256k1_ge_set_xo_var' [-Wunused-function] static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd); ^ ../src/secp256k1-src/src/group.h:57:12: warning: unused function 'secp256k1_ge_is_infinity' [-Wunused-function] static int secp256k1_ge_is_infinity(const secp256k1_ge *a); ^ ../src/secp256k1-src/src/group.h:60:12: warning: unused function 'secp256k1_ge_is_valid_var' [-Wunused-function] static int secp256k1_ge_is_valid_var(const secp256k1_ge *a); ^ ../src/secp256k1-src/src/group.h:62:13: warning: unused function 'secp256k1_ge_neg' [-Wunused-function] static void secp256k1_ge_neg(secp256k1_ge *r, const secp256k1_ge *a); ^ ../src/secp256k1-src/src/group.h:65:13: warning: unused function 'secp256k1_ge_set_gej' [-Wunused-function] static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a); ^ ../src/secp256k1-src/src/group.h:68:13: warning: unused function 'secp256k1_ge_set_all_gej_var' [-Wunused-function] static void secp256k1_ge_set_all_gej_var(secp256k1_ge *r, const secp256k1_gej *a, size_t len); ^ ../src/secp256k1-src/src/group.h:75:13: warning: unused function 'secp256k1_ge_globalz_set_table_gej' [-Wunused-function] static void secp256k1_ge_globalz_set_table_gej(size_t len, secp256k1_ge *r, secp256k1_fe *globalz, const secp256k1_gej *a, const secp256k1_fe *zr); ^ ../src/secp256k1-src/src/group.h:78:13: warning: unused function 'secp256k1_ge_set_infinity' [-Wunused-function] static void secp256k1_ge_set_infinity(secp256k1_ge *r); ^ ../src/secp256k1-src/src/group.h:81:13: warning: unused function 'secp256k1_gej_set_infinity' [-Wunused-function] static void secp256k1_gej_set_infinity(secp256k1_gej *r); ^ ../src/secp256k1-src/src/group.h:84:13: warning: unused function 'secp256k1_gej_set_ge' [-Wunused-function] static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a); ^ ../src/secp256k1-src/src/group.h:87:12: warning: unused function 'secp256k1_gej_eq_x_var' [-Wunused-function] static int secp256k1_gej_eq_x_var(const secp256k1_fe *x, const secp256k1_gej *a); ^ ../src/secp256k1-src/src/group.h:90:13: warning: unused function 'secp256k1_gej_neg' [-Wunused-function] static void secp256k1_gej_neg(secp256k1_gej *r, const secp256k1_gej *a); ^ ../src/secp256k1-src/src/group.h:93:12: warning: unused function 'secp256k1_gej_is_infinity' [-Wunused-function] static int secp256k1_gej_is_infinity(const secp256k1_gej *a); ^ ../src/secp256k1-src/src/group.h:96:12: warning: unused function 'secp256k1_gej_has_quad_y_var' [-Wunused-function] static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a); ^ ../src/secp256k1-src/src/group.h????13: warning: unused function 'secp256k1_gej_double_nonzero' [-Wunused-function] static void secp256k1_gej_double_nonzero(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr); ^ ../src/secp256k1-src/src/group.h:103:13: warning: unused function 'secp256k1_gej_double_var' [-Wunused-function] static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr); ^ ../src/secp256k1-src/src/group.h:106:13: warning: unused function 'secp256k1_gej_add_var' [-Wunused-function] static void secp256k1_gej_add_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr); ^ ../src/secp256k1-src/src/group.h:109:13: warning: unused function 'secp256k1_gej_add_ge' [-Wunused-function] static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b); ^ ../src/secp256k1-src/src/group.h:114:13: warning: unused function 'secp256k1_gej_add_ge_var' [-Wunused-function] static void secp256k1_gej_add_ge_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr); ^ ../src/secp256k1-src/src/group.h:117:13: warning: unused function 'secp256k1_gej_add_zinv_var' [-Wunused-function] static void secp256k1_gej_add_zinv_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv); ^ ../src/secp256k1-src/src/group.h:125:13: warning: unused function 'secp256k1_gej_clear' [-Wunused-function] static void secp256k1_gej_clear(secp256k1_gej *r); ^ ../src/secp256k1-src/src/group.h:128:13: warning: unused function 'secp256k1_ge_clear' [-Wunused-function] static void secp256k1_ge_clear(secp256k1_ge *r); ^ ../src/secp256k1-src/src/group.h:131:13: warning: unused function 'secp256k1_ge_to_storage' [-Wunused-function] static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a); ^ ../src/secp256k1-src/src/group.h:134:13: warning: unused function 'secp256k1_ge_from_storage' [-Wunused-function] static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a); ^ ../src/secp256k1-src/src/group.h:137:13: warning: unused function 'secp256k1_ge_storage_cmov' [-Wunused-function] static void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag); ^ ../src/secp256k1-src/src/group.h:140:13: warning: unused function 'secp256k1_gej_rescale' [-Wunused-function] static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *b); ^ In file included from ../src/privatekey.cc:4: In file included from ../src/secp256k1-src/src/scalar_impl.h:20: ../src/secp256k1-src/src/scalar_4x64_impl.h:83:12: warning: unused function 'secp256k1_scalar_add' [-Wunused-function] static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) ^ ../src/secp256k1-src/src/scalar_4x64_impl.h:897:12: warning: unused function 'secp256k1_scalar_shr_int' [-Wunused-function] static int secp256k1_scalar_shr_int(secp256k1_scalar *r, int n) ^ In file included from ../src/privatekey.cc:4: ../src/secp256k1-src/src/scalar_impl.h:225:13: warning: unused function 'secp256k1_scalar_inverse_var' [-Wunused-function] static void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_scalar *x) ^ In file included from ../src/privatekey.cc:4: In file included from ../src/secp256k1-src/src/scalar_impl.h:20: ../src/secp256k1-src/src/scalar_4x64_impl.h:140:13: warning: unused function 'secp256k1_scalar_negate' [-Wunused-function] static void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a) ^ ../src/secp256k1-src/src/scalar_4x64_impl.h:156:12: warning: unused function 'secp256k1_scalar_is_high' [-Wunused-function] static int secp256k1_scalar_is_high(const secp256k1_scalar *a) ^ ../src/secp256k1-src/src/scalar_4x64_impl.h:168:12: warning: unused function 'secp256k1_scalar_cond_negate' [-Wunused-function] static int secp256k1_scalar_cond_negate(secp256k1_scalar *r, int flag) ^ 63 warnings generated. CXX(target) Release/obj.target/secp256k1/src/publickey.o CXX(target) Release/obj.target/secp256k1/src/signature.o CXX(target) Release/obj.target/secp256k1/src/ecdsa.o ../src/ecdsa.cc:88:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] obj->Set(info.GetIsolate()->GetCurrentContext(), Nan::Newv8::String("signature").ToLocalChecked(), COPY_BUFFER(&output[0], 64)); ^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/ecdsa.cc:89:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] obj->Set(info.GetIsolate()->GetCurrentContext(), Nan::Newv8::String("recovery").ToLocalChecked(), Nan::Newv8::Number(recid)); ^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. CXX(target) Release/obj.target/secp256k1/src/ecdh.o CC(target) Release/obj.target/secp256k1/src/secp256k1-src/src/secp256k1.o In file included from ../src/secp256k1-src/src/secp256k1.c:11: ../src/secp256k1-src/src/field_impl.h:266:13: warning: unused function 'secp256k1_fe_inv_all_var' [-Wunused-function] static void secp256k1_fe_inv_all_var(secp256k1_fe *r, const secp256k1_fe *a, size_t len) ^ In file included from ../src/secp256k1-src/src/secp256k1.c:13: ../src/secp256k1-src/src/group_impl.h:202:13: warning: unused function 'secp256k1_ge_set_infinity' [-Wunused-function] static void secp256k1_ge_set_infinity(secp256k1_ge *r) ^ ../src/secp256k1-src/src/group_impl.h:691:12: warning: unused function 'secp256k1_gej_has_quad_y_var' [-Wunused-function] static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) ^ ../src/secp256k1-src/src/group_impl.h:272:12: warning: unused function 'secp256k1_gej_is_valid_var' [-Wunused-function] static int secp256k1_gej_is_valid_var(const secp256k1_gej *a) ^ In file included from ../src/secp256k1-src/src/secp256k1.c:14: ../src/secp256k1-src/src/ecmult_impl.h:1135:12: warning: unused function 'secp256k1_ecmult_multi_var' [-Wunused-function] static int secp256k1_ecmult_multi_var(const secp256k1_ecmult_context *ctx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void ... ^ ../src/secp256k1-src/src/ecmult_impl.h:669:12: warning: unused function 'secp256k1_ecmult_strauss_batch_single' [-Wunused-function] static int secp256k1_ecmult_strauss_batch_single(const secp256k1_ecmult_context *actx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callba... ^ ../src/secp256k1-src/src/ecmult_impl.h:1042:12: warning: unused function 'secp256k1_ecmult_pippenger_batch_single' [-Wunused-function] static int secp256k1_ecmult_pippenger_batch_single(const secp256k1_ecmult_context *actx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_call... ^ 7 warnings generated. CC(target) Release/obj.target/secp256k1/src/secp256k1-src/contrib/lax_der_parsing.o CC(target) Release/obj.target/secp256k1/src/secp256k1-src/contrib/lax_der_privatekey_parsing.o SOLINK_MODULE(target) Release/secp256k1.node ganache-cli@6.7.0 added 88 packages from 85 contributors in 13.26s</pre>

【问题讨论】:

同样的问题。你在 OSX Catalina 上吗?看起来构建脚本正在尝试编译 addon.cc 并生成此错误。我猜它包含了错误的头文件。 @Weisel2095 你能修复这个错误吗?我遇到了同样的问题,不知道如何解决。 【参考方案1】:

刚刚得到这个答案。

我没有使用 npm 安装 ganache-cli,而是使用 yarn 重试,它成功了。 truffle 也发生了同样的事情,它没有使用 npm 正确安装,但它已安装并使用 yarn 运行良好。

【讨论】:

以上是关于npm 配置问题和安装 ganache-cli 和松露的错误的主要内容,如果未能解决你的问题,请参考以下文章

找不到命令:ganache-cli

区块链-智能合约工程师第四篇:Truffle框架安装和介绍(Windows)

区块链-智能合约工程师第四篇:Truffle框架安装和介绍(Windows)

(2022年最新版本)Linux下基于ganache(v6.12.2)的简单投票DAPP(web3@1.7.1)(Node.js: v16.14.0.)(solc:‘0.8.12+commit)

ganache-cli命令行参数说明

Truffle 和 Ganache-cli 测试用例失败